Twitter Posting with PHP and Curl

As it’s so utterly and incredibly easy to do this, I thought I’d add to the resources of how to post to message to your Twitter account using PHP and Curl.

So, to add to the other PHP scripts I’ve been plonking out here, here is the PHP source code to a simpleย  function which will post to a Twitter account. Send data to it from a form or a service, or even another script, even from an llHTTPRequest from an LSL script in Second Life! Easy and interesting stuff, that messaging. ๐Ÿ˜‰

Here you go:

Free PHP5 Script to grab YOUR flickr Photos

UPDATED: To support Curl, if it is installed. It appears that some servers have the ‘fopen’ wrapper disabled, preferring Curl – which is faster too ! )

OK, so I have just knocked up a PHP5 script which, WITH SOME MORE WORK (on your part) will grab all your photos from flickr, should you want to move away from them.

This script takes your screen name and then lists all your photos, with the original photo file url, the title, description and any tags, comments and geocoding data too.

That’s as far as I go – the script is not doing any downloading at all – I leave the rest up to you ๐Ÿ™‚ You could add the details to a database, store images anywhere you like, ftp them somewhere – it’s up to you to get the PHP to do what you want.

If I get the time, I will create a desktop version which does the same thing. The tricky bit might be deciding on a static xml format for all the rest of the data – maybe a big RSS file would do. Or OPML. Or both?

Here is the PHP5 SOURCE.

NB: You MUST have PHP5 with simplexml and fopen wrappers or Curl activated (Some webhosts prefer you to use Curl, so they deactivate file_get_contents)

Enjoy! Feel free to use this code and hack and mash it up at will. Please add to the comments of this post, if you do extend it. Cheers! ๐Ÿ™‚