Categories
Activism Code Pete Taylor (shameless self publicity) Social Media Websites

Tweet your Candidate is back!

Following the initial joy and elation at discovering we’ve got yet another chance to express our electoral opinions I’ve updated TweetYourMP.com to now include candidate information for the forthcoming 2017 snap General Election, and I’ve even managed to secure yet another dot com – TweetYourCandidate.com includes the details of over 3,000 candidates standing in the 650 constituencies across the UK.

Fortunately this time around I’ve been able to make use of the very useful candidate data from The Democracy Club which has saved a lot of time and made it possible to turn update the site in a very short space of time.

This time around there’s a new feature to play with: the campaign generator makes it possible to create your own pre-filled twitter campaigns to share.

As an example I created a very simple campaign – posing possibly the easiest question to people vying to be your Member of Parliament:

https://twitter.com/kimondo/status/859686716080357376

As I live in the Vauxhall constituency of former MP Kate Hoey I have had a number of replies:

First to reply was Harini Iyengar for The Women’s Equality Party:

https://twitter.com/Harini_Iyengar/status/859735962213122056

and now without the ringer:

https://twitter.com/Harini_Iyengar/status/859737011439251456

Then Mark Chapman for the Pirate Party:

https://twitter.com/Pirate_Lennon/status/859738317297942528

George Turner for the Lib Dems:

https://twitter.com/georgenturner/status/859738670219309058

and Gulnar Hasnain for the Greens

https://twitter.com/gulnar73/status/859742839361736704

Sadly I’ve yet to receive replies from Kate Hoey (The former Labour MP) nor Dolly Theis who is the Conservative and Unionist Party candidate, although in the case of the latter I did tweet later as my initial candidate list didn’t include her twitter details. UKIP are not running in Vauxhall.

So far a number of campaigns have made use of the tool – which is provided free of charge, as a spare time project.

To ask the same question to your candidates visit TweetYourCandidate.com

Categories
Activism Code Social Media

Send pre-filled tweets using tweetyourmp.com

Rather excitingly my little side project tweetyourmp.com was mentioned by pukka chef Jamie Oliver as part of his campaign for healthy eating:

Big yellow sign
Big yellow sign

After my panic that I might not have enough bandwidth subsided, I thought it might be a good moment to give Tweety our MP a bit of love, so I’ve added the option to pre-fill tweets.

The tweet text is passed across using a custom URL – this can be done as follows:

Pre-filling in the postcode and tweet message:

Make sure you use the URL http://tweetyourmp.com/index.php

The URL needs to be in the format:

http://tweetyourmp.com/index.php?postcode=SW2 2AX&tweetmsg=twitter message&sentvia=@kimondo

the parts being:

http://tweetyourmp.com/index.php

?postcode= the postcode for constituency lookup

&tweetmsg= the twitter message

&sentvia= the twitter handle for the sender (default is @tweet_your_mp)

You can leave out the postcode (or the tweet message!):

http://tweetyourmp.com/index.php?tweetmsg=twitter message&sentvia=@kimondo

Passing values to tweetyourmp.com in this way works with spaces, but safer to encode the message and postcode parts using http://andrewu.co.uk/tools/uriencoder/ to replace characters with %20 for a space.

so the above becomes:

http://tweetyourmp.com/index.php?postcode=SW22AX&tweetmsg=twitter%20message&sentvia=@kimondo

This example generates:

hello @ChukaUmunna your twitter message via @kimondo

as the tweet.

Important note on using hashtags

I had to use a bit of a hack to make it possible to have a pre-filled tweet with a hashtag. As # is used to denote an anchor link when you stick it in a URL the rest of the URL gets ignored by the bit of the code that reads the tweet from it.

To get round this use an asterisk * in place of a hash # – the code then puts the hash back in when it sends the tweet:

http://tweetyourmp.com/index.php?postcode=SW22AX&tweetmsg=twitter%20message%20*hashtag&sentvia=@kimondo

This hashtag example generates

hello @ChukaUmunna your twitter message #hashtag via @kimondo

The salutation is fixed as ‘Hello’ but can be changed – is important not to begin the tweet with the @handle as it reduces its visibility and ‘Hi’ is a bit American sounding hence the hello.

Next on the list is building some sort of Raspberry Pi based tweet totaliser. You can download the (very simple) code that runs Tweet your MP on GitHub – a couple of interesting options are to use the code in a thankyou email after a supporter has completed an action to give it a bit more impact, or to sort through your data and merge in constituency contacts in an email.

Note that some MPs don’t consider twitter an ‘official’ communication format so this is best combined with an email or letter to an MP.

tweetyourmp.com is made possible thanks to the theyworkforyou.com API – this is free for charitable use up to 50,000 queries.

Update: I’ve now added a page that automates this process and builds a bit.ly link with the correct address!

Categories
Pete Taylor (shameless self publicity)

We have lift off!

A while ago as part of my Kickstarter habit I excitedly backed a space program. For the princely sum of $10 I get to control a satellite that’s about the size of a coffee machine for 100 seconds.

Sadly Fortunately in this instance the satellite’s functions are limited to sending tweets from space and taking a couple of photos with it’s on-board camera, although the music from Diamonds are Forever will be playing in my head as I imagine wielding control of a thing flying through space – even if it is just for a moment and lacks a laser death ray.

Still it’s rather nice to see a very ambitious Kickstarter funded project come to fruition – given that many more earthly bound campaigns fail after the funding hurdle has been reached.

Here’s the cube blasting off on board supply ship onboard a rocket (launched magnificently from a swamp):

Spaaaaaceship AwaaaaY!
Spaaaaaceship AwaaaaY!

And here it is docking with the International Space Station:

At some point in the future it will be thrown out of an airlock in a graceful launch sequence. Suggestions of things I’m going to make it tweet (along with the 3000 or so other backers) are most welcome – I get 10 historic messages to broadcast from space and the option of 2 photos from the on-board camera.

Categories
Code Social Media

Missing the twitter API? here’s something rather useful

If you’ve  lamented the loss of twitter’s v1 API which was switched off in June 2013 – and the ability to generate RSS feeds of your tweets and mentions here’s a handy tool for getting them back.

twools
twitter + tools

Twools is a set of  twitter – tools (geddit?) to generate feeds that uses twitter’s API version 1.1 – you’ll need to apply for an API key to make it work, and you’ll also need a server to host the software. I’m running twools on my cheap-as-chips 123-reg hosting package, so if you’ve got web space that’s capable of hosting a wordpress blog you should be ok. Installation is a matter of uploading to your webspace and following the enclosed instructions on modifing the settings file.

One note – this is a beta tool, so it’s provided as-is – it does include password protection, but I’d suggest using a different login to your normal one, and not making the front-page public. The feeds are public but fairly easy to hide.

RSS feeds are quite useful (despite what twitter thinks) – it’s possible to use them for things like a twitter badge on your website, or if you’re feeling a bit more creative setting up triggers on If This Then That (IFTTT.com).

Twitter triggers disappeared from IFTTT last year – but the very handy Twools can help you get them back.

For instance – you want to get an email when someone mentions your website on twitter – or perhaps you don’t want to miss a tweet from your mother in law. Or perhaps you want to drive some hardware with a tweet – like the Raspberry Pi ledborg I had a go with recently.

Using the feeds generated by twools you can generate notifications really easily whenever a new item is added to the feed – here’s an example on IFTTT.com. There is a limit built into the API but i’ve not hit this yet.

All in all it’s very useful – you can download Twools by subscribing to the newsletter on http://iag.me/twools/ – the author Ian Anderson Gray also responds to tweets.

Update: Twools is now available as a wordpress plugin! (taking care of the login security)  

Categories
Activism Code Social Media

Tweet rotator

Sometimes it’s handy to be able to get people to tweet from a selection of messages – for instance on a thank you page after taking an action. Usually everyone just hits the tweet button and sends multiple versions of the same message out on twitter.

One thing that was interesting about the (I hate to mention it but..) Kony 2012 campaign was the splattergun approach to sharing multiple messages on twitter. 

To make things a little bit more varied you can use this super-simple tweet rotator script – this picks a tweet at random from a list you provide in the javascript. It’s fairly easy just to come up with 10 or so different variations on your tweet and include them in the script – see the example below. 

It’s also something that might work quite well with advocacy targets – anyone using tweetdeck to monitor their @mentions will see a varied response – particularly when you factor in that a few of your activists will change the tweet before they send it. 

Download it on GitHub

It’s also handy to avoid social media gaffes like this one.

Categories
Activism Code Random Social Media Work stuff

Tweet your MP

Ever wanted to send a tweet to your MP? not sure if your Member of Parliament has embraced social media? want to put a handy tool to do so on your website?

Tweet Your MP
Tweet your MP

Here’s a little script I wrote to find your MP using a postcode (via the TheyWorkForYou.com API) and send them a tweet. Info, source and background below.

It’s possible to tweak this tool to return email address, postal address, phone number and facebook page (if they have one) – you can also add custom information to each MP as well. My data set includes 436 twitter accounts for MPs – slightly more than Tweetminster’s 409 but I have included auto twitter accounts (so people can see you’re tweeting your MP, even if they don’t respond). I’ve tried to avoid spoof accounts.

Bit of background about this tool

This tool works by converting the postcode into a constituency name on TheyWorkForYou.com, and then matching this constituency name with MP’s details on a local MySQL database table. If you don’t want to use TheyWorkForYou.com’s API it is possible to buy a constituency postcode database from Ordinance Survey for £350.

For a while I’ve been working on an open-source activism tool. It was born out of curiosity, an excuse to learn a bit more about php and as a way of proving email to MP actions courtesy of the very useful theyworkforyou.com API.

Unfortunately it became on of these projects that got more and more complicated – once I’d got round to adding a graphical user front end, SMS texting, and add on modules it started getting a bit too big for me to handle. Plus I started encountering problems with PHP’s send mail function getting blocked by outlook servers, experimented a bit with pop mail senders and then started looking at using online cloud services.

The past 2 organisations I’ve worked for have used off the shelf tools instead, making the aim of the project a little bit redundant.

I still have a copy of all the code (with lots of comments) if anyone would like it – it’s in an alpha sort of works if you’re prepared to spend a bit of time tinkering with it state. Just drop me a line. All I ask is that if you do improve on it, please make it publicly available (it is GPL licensed).

I’ve also been thinking about the effectiveness of email-your-mp actions with identikit emails embedded in them – I think using twitter or even printed out letters might be a better way forward to creatively attract attention, and avoid the boring accusations of ‘slacktivism’.

So in the meantime I’ve taken the bits of the tool that did work, and have reworked them into a much simpler ‘Tweet your MP’ toolkit. The idea of this is to provide a simple widget you can embed on your website – I’ve seen plenty of websites that just link to TheyWorkForYou.com, or refer people to google, so this provides a way of keeping activists on your page.

In the example above I’ve just gone for twitter and website information – but with a few tweaks to the code you can add email your MP (via a mailto link) phone your MP or write a paper letter to your MP functionality.

Requirements & the code

To get this to work you will need access to a MySQL database and PHP. This is currently running on my server which is a cheap-as-chips 123-reg setup. Check your ISP’s documentation for support on how to get these logins. I’ve labelled the code to show what it does.

If there are any corrections please get in touch with me and i’ll add them.

Download the code from GitHub

I’m updating this to fix problems and add enhancements. At the moment the code does contain a bit of stuff left over from the webtivist project. The GitHub version will always be the most up to date.

To make this work you’ll need to upload the MP data spreadsheet to your MySQL server (I used the import function on my 123reg hosting and it worked fine) this has every MP’s contact details – if you’d like access to this please drop me a line as I’d like to keep track of who’s using it!

Then you’ll need to edit the settings.php file to include the login for your MySQL database, the hostname and tablename for your MP database.

You’ll also need to apply for a theyworkforyou.com API key – there’s usually no charge to use this for small volumes. They prefer it if you ask them if you’re intending to use it a lot. Please Please don’t use this to send identical emails to MPs.

For the twitter part you’ll also need a Twitter API key  I changed this to use the more simple @mention option on twitter.

Corrections / suggestions and contributions

Thanks to MPs being arrested for things, standing down or departing, this data may become out of date over time.  If there is incorrect information please let me know and I’ll update it.

This script makes use of the TheyWorkForYou.com API and Ruben Arakelyan’s php script. Check the comments in the code for more information.

Update: this script has now moved to tweetyourMP.com

Categories
Social Media

Twitter’s not just for elections…

I’m often looking for ways to engage with my MP – usually online, since that’s how a lot of things are done in the 21st century (banking, paying bills, booking travel etc). However sometimes I get a little bit despondent about writing to elected representatives who then don’t respond.

Neither my last MP Vince Cable, or now (since I’ve moved to Kingston) Ed Davey seem to do the online thing, with not much response to email and no tweets since May 2010.

In fairness, both seem to blog quite a bit and I haven’t yet tested their response rate to a dead-tree format letter.

But this got me thinking – is twitter and social media truly a way for MPs to reach out and engage with their electorate? or is it just a handy tool for some publicity every 4 years when they want our votes.

It would be a shame if the latter were true, since it’s a relatively easy way to publish information, particularly to a younger audience.

So I’ve compiled a list of MPs who haven’t tweeted in the last 6 months (most haven’t since the last election), along with a count of their followers:

Twitter MP followers
@vincecable
22094
@Vaizeyculture
3863
@Mike_Fabricant
2639
@HazelBlearsMP
2522
@DavidWrightMP
2507
@VirendraSharma
2505
@AlanDuncan4MP
2494
@leighmp * – now moved to @andyburnhammp and updated!
2004
@markdurkan
1946
@KarenBuckMP
1780
@naomi_long
1766
@eddaveykands
1543
@gildernewmp
1518
@Linda_Riordan
1489
@acarmichaelmp
1462
@Moore4Borders
1443
@nicolablackwood
1328
@kwasikwarteng
1026
@JDjanogly
885
@DavidEDrew
823
@Michael_Ellis1
658
@rosie4westlancs
634
@AMcDonnellMP
616
@George4MVMP
562
@NickSmith4BG
516
@PhilipDavies422
507
@C4NWestminster
452
@MaryMacleod4MP
449
@StocktonNorth
378
@edwardleighac
76

With over 22 thousand followers Vince Cable is missing a trick. Perhaps he’s lost the password?

As always corrections and feedback most welcome.

Update – @leighMP is now @andyburnhammp which is regularly updated – thanks to @CollectorManiac for pointing that one out.

Updated update: check out more MP twitter information at tweetyourMP.com

Categories
Pete Taylor (shameless self publicity) Social Media

My avatar’s now in a water pistol duel

Right, this is slightly bizarre. My @kimondo avatar picture, which has already been blasted into orbit on the space shuttle, is now starring in a series of youtube water pistol shootouts.

It seemed to make sense at the time. Thanks to @firebox for the feature. Here’s hoping for some freebies.

Categories
Comment Social Media

Don’t retweet this to get the #newtwitter

Well it seems the new twitter is finally hitting the UK with the #newtwitter hashtag topping the trending charts, although it seems that many are falling for the “follow me / retweet me” to get access to new twitter, which sadly doesn’t work. Anyone who claims to be able to unlock the new twitter for you is a big fat liar.

Image of the new twitter page
All change here

The new layout features a 50/50 split between the twitter stream and trending, lists and suggestion columns – which should suit the more popular widescreen monitor formats. Search is more prominently sitting at the top of the page, and lists and searches are included in dropdown menus. Clicking on a tweet operates a slide out page with more information on that tweet or user.

The new layout seems to have messed up a lot of custom backgrounds although these are a bit of an ugly hack which attempt to shoehorn more contact information onto a twitter page.

In terms of new features – twitter have now launched shortcuts to a lot of the common twitter functions:

Image of twitter short cuts
Just like a twitter client

Hitting a key brings up a lightbox style popup window with the appropriate function.

Favourite tweets also have a bit more prominence as well, which is a feature I’ve hardly bothered with.

The overall feel is that twitter.com includes more of the features of the many twitter clients that are available – which in itself is perhaps a reaction to the laissez-faire attitude twitter has to it’s service: build too good an API and no-one will visit your website anymore.

Categories
Pete Taylor (shameless self publicity) Social Media

How to use @anywhere to brand your tweets…

I’ve been having a play with twitter’s @anywhere service that allows you to add twitter functionality to any website.

There are functions that turn @usernames into links automatically, but interestingly it’s also possible to edit the ‘sent via’ bit of text that appears next to your tweet.

For example the shamelessly self publicising:

Add branding to a tweet
I stuck with a boring name for this one

The via Kimondo (Pete Taylor) bit links to whatever site you set up when you register your app, which makes for some handy self publicity. I’m fairly sure that setting the app name to ‘buy some teeth whitening stuff here’ would infringe on Twitter’s terms of service, but I’m surprised no-ones tried it yet.

There’s a handy step by step guide on how to create your own @anywhere box here and you can see my attempt here. You can already get wordpress plugins that dovetail the functionality into your site.

You can follow me @kimondo to see the tweet.