Tuesday, July 7, 2009

Posting to Twitter from the Command Line using cURL

If you enjoy enjoy "hacking" Twitter's API as Zak and I do you probably already know how simple and easy it is to use it.

You can post your updates via your favorite scripting language. Zak likes Ruby but I prefer using AutoIt3.

You can post Twitter updates via Windows Cmd.exe and cURL.

curl --basic --user screen_name:password --data status=" $text_of_tweet " http://twitter.com/statuses/update.xml


Or from AutoIt with this line.

RunWait(@ComSpec & " /c " & 'curl --basic --user screen_name:password --data status="' & $text_of_tweet & '" http://twitter.com/statuses/update.xml', "", @SW_HIDE)

;$text_of_tweet = your update

Zak and I have written our own little twitter client programs to make tweeting easier.

Mine automatically saves all my postings to a file on my system for later reference and many other things to make life easier.

If you enjoy exploring how stuffs works, check out the Twitter API and cURL.

Have Fun,
Zip

No comments: