Using cURL to Post Updates to Twitter
Heres a small snippet of code I found that will successfully post updates to your Twitter account:
curl --basic --user username:password --data status="Having fun with cURL" http://twitter.com/statuses/update.xml
The command ‘curl’ is normally present on most Linux distro’s these days. Windows users will need to Google and download it. To use the code above simply replace ‘username:password’ with your real ‘username:password‘, the string of status in double quotes is the update that will actually appear on your Twitter page. The url present at the end of the code is the Twitter API endpoint.
Twitter will reply with a response similar to the following:
<?xml version="1.0" encoding="UTF-8"?>
<status>
<created_at>Sun Apr 08 01:25:56 +0000 2007</created_at>
<id>12345xxx</id>
<text>Having fun with cURL</text>
<user>
<id>xxxxxxx</id>
<name>Your Name</name>
<screen_name>your_username</screen_name>
<location></location>
<description></description>
<profile_image_url>[removed]</profile_image_url>
<url></url>
<protected>true</protected>
</user>
</status>
Note: I have replaced specific numbers with ‘x’s.

July 28th, 2008 at 5:30 pm
joke look green wood all green
January 23rd, 2008 at 12:19 pm
Thanks for this. Works perfectly.
January 23rd, 2008 at 12:13 pm
[...] This blog post shows how to post to twitter using curl. [...]
April 8th, 2007 at 7:41 pm
It seems to work too easily.