Dave Winer began posting about sending a photo from his iPhone to Twitter via flickr recently. (here and here are just two of them)

I thought this was a great idea so I decided to write an application and possibly offer it as a service. Well the service thing fell to the wayside rapidly because you have to have the Twitter username and password to post the Tweet. I didn’t like that idea, so decided just to give the app away. Use it, don’t use it, complain about the coding style, or whatever you like.

The application is fairly straight forward. It doesn’t depend on the iPhone, you can post photo’s anyway you like. You tag the photo’s so that the application knows which photo’s to upload. Run it from a cron job on your server and away you go. The parameters necessary for all this to work are fairly well documented. You need things like a flickr api key, flickr username, Twitter username/password, the tag to grab and a couple others.

One thing to not is I had to subtract 900 seconds from the timestamps that I send to flickr otherwise I would miss photo’s. It seems from my tests that flickr tends to indicate that a photo was uploaded before it was taken. Without subtracting that time I would miss uploaded photo’s due to the time I last checked was after the time reported by flickr’s api for the photo. You can adjust that time if necessary.

I hope it works for everyone, enjoy. I have only tested this in my environment so your mileage may vary. And thanks to Dave Winer for the terrific idea.

This application is written in PHP and should work in PHP4 or PHP5

Download Photo2Twitter