I still can’t believe how easy it is to post to Twitter using their Application Program Interface. All you need is the very handy cURL utility and you’re all set to start tweeting from the command prompt. I managed to take this one step further by creating a very simple Twitter client in VBScript.
strTweet = InputBox(“What are you doing?”, _
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run(“curl -u Your Twitter ID:Your Twitter password -d status=” & chr(34) & strTweet & chr(34) & ” http://twitter.com/statuses/update.xml”), 1, TRUE
Before running the script, replace the red text with your Twitter user ID and password. cURL does use basic authentication to log you on, so you should be safe.
When you run the script, an input box appears for your typing your tweet. I know there’s a way to make sure the tweet does not exceed 140 characters but for now I just wanted to make a very quick ‘n’ dirty Twitter client. After you hit ENTER, the script launches cURL to post your tweet on Twitter. It should appear online instantly.