You can now follow Alex’s Cocktail Making on Twitter @cocktaildaily so I’d love it if you followed me.
I have heard a lot about the twitter API lately being really really easy to use and so having hacked things together with the delicious, flickr, eBay, typepad and facebook apis in the past I thought it was time to give twitter a go. The whole development process start to finish took me 25minutes (started at 18:11 and finished at 18:36) from creating a new twitter account to having a daily updating script which pushed a random cocktail with over a certain score and a reasonable likelihood of not being rude to twitter. It took me 12minutes to write this blog post! Below are the resources that should make this easy for you to do and at the very bottom is the code I used (without my username and password)!
http://apiwiki.twitter.com/Things-Every-Developer-Should-Know (the twitter documentation, curl from command line at the bottom – it’s cool you can update twitter from command line)
http://morethanseven.net/2007/01/20/posting-to-twitter-using-php/ (this page showed me which curl-setopt I needed to send the message (it’s a post) and is now very slightly out of date but still should get you over the hump)
http://us2.php.net/manual/en/function.curl-setopt.php (the curl documentation)
For completeness here’s the code I used… you can easily modify it to do your own:
// Set username and password
$username = 'ENTERYOURUSERNAME';
$password = 'ENTERYOURPASSWORD';// the message you want to send (I had a bunch of code here)
$message = “enter your message here”;
// The twitter API address
$url = 'http://twitter.com/statuses/update.json';// Set up and execute the curl process
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1); // POST not GET
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);// check for success or failure
if (empty($buffer)) {echo 'there was a problem with the twitter updater';} else {};

Fast and easy way to update status in twitter with PHP in 2 steps – http://ayauho.com/~ay
Posted by: ayauho | January 05, 2011 at 05:32 AM
The bird wishes it were a cloud.
The cloud wishes it were a bird. O(∩_∩)O~
Posted by: UGG Classic Tall Metallic | December 18, 2010 at 12:04 AM
For today, I will learn something new.
Posted by: jordans for sale | November 17, 2010 at 06:23 PM
*I hope my family and all friends are happy everyday.
Posted by: christian louboutin shoes | November 16, 2010 at 07:33 PM
Good at planning, good at time management.*
Posted by: coach outlet stores | November 15, 2010 at 07:50 PM
I am a Twitter fan, and I was looking for the way to update my status using php. Fortunately, I found this entry of your blog that helped me a lot. Thanks for posting this very interesting information.
Posted by: Kamagra | November 15, 2010 at 10:17 AM
The African tragedy!
Posted by: Air Jordan | November 15, 2010 at 01:09 AM
*Oh I hope you all have a blessed day
Posted by: buy from taobao | November 12, 2010 at 11:46 PM
I want to bring out the secrets of nature and apply them for the happiness of man . I don't know of any better service to offer for the short time we are in the world .
Posted by: cheap air jordans | November 12, 2010 at 10:47 PM
I love to read your blog because you're always finding the best way to teach about how we can get new potions to use them on Internet and it is really exciting.
Posted by: Generic Viagra | November 12, 2010 at 09:41 AM