Flickrtweeter: automatically tweet your flickr pics

A few weeks ago I decided to roll my own script to automatically twitter an update if I posted a photo onto my flickr pages with a certain tag.  I know that there are third party services out there that can do this for you (e.g. Snaptweet, Twittergram) but I thought it’d be an interesting project to do it myself.  As well as (obviously) requiring flickr and twitter accounts, it also requires a bit.ly account and API key as it uses this service to produce a shortened URL for the photo to include in the tweet.

The script is written in Perl and is fairly straitforward.  It pulls the Atom feed of my flickr account and checks any photos tagged “twitme” against a list of photos it has already seen and tweeted.  It then passes the photo’s URL through bit.ly to get a shortened version and builds a tweet using a standard prefix, the photo’s title from flickr, and the bit.ly’ified URL.  It then attempts to post the tweet.

The script uses LWP::Simple for HTTP GETs to flickr and bit.ly, XML::Simple to parse the responses, Storable to maintain a cache file of seen photos, Net::Twitter to talk to twitter itself and URI::Escape to escape the photo’s URL before passing it to bit.ly.  It also uses the sysopen call from Fcntl to manage a lockfile – I run it as a cron job so this seemed a sensible precaution.

It can be configured by setting variables at the start of the script.  All are commented (I hope) reasonably clearly.  It can be downloaded and used under the terms of the GNU Public License.  I originally called it flickr2twitter but as this appears to be the name of a Firefox Addon I have renamed it flickrtweeter.

Act now to protect Data Protection

Protecting your bits. Open Rights Group

The Open Rights Group, of which I am a founder member, has announced a call to action to try and prevent the inclusion of Clause 152 in the Coroners and Justice Bill, due to go before Parliament in the near future.

This clause, should it become law, will essentially remove the protections we enjoy under the Data Protection Act and allow Government to mandate the sharing of your personal data with no effective oversight.

This means that data you have provided to the Government for one purpose, with a guarantee under law that it would be used soley for that purpose, would be available for other purposes without the need for further consent.  The other purposes could be pretty much anything – this is not necessarily about security or terrorism or immigration control or any of the other hot-button topics Labour have used over the past few years to justify their more authoritarian and intrusive policies.

I’m not going to go over the details any further in this post, my intentions here are to flag the issue and help in a small way to raise awareness.  There is a lot of information on the Bill and this clause available on the internet, follow the link above to the Open Rights Group site or just trawl through the UK news sites for more.

If this concerns you please consider joining the campaign to get this clause removed from the Bill.  Write to your MP, visit your MP, dicuss with friends, family and colleagues – whatever you have time for.

Update 8th March 2009

Great News – it looks like the proposal has been removed from the Bill (Guardian, Telegraph).  One small victory for common sense and reason.