This is a simple tutorial which is going to teach you how to update your twitter status using cURL.
What us cURL?
cURL is a command line utility which is used to transfer data using URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3 and RTSP.
cURL is availabe mostly on all Linux distros but you can download a binary package from cURL's download page if you don't have it installed.
Scripting status update
Below is a simple snippet which uses Twitter API to update your twitter status:
curl --basic --user username:password --data status="Dreamincode rocks" http://twitter.com/statuses/update.xml
To use this snippet open the Terminal and paste the above code using your own twitter username and password.
You can even change the status if you wish.
Explaining the snippet
--basic --user username:password
The above piece of code will authenticate your Twitter username and password. The API is password protected so it requires your Twitter username and password.
--data status="Dreamincode rocks"
The above piece of code will send the data to the API i.e your new status which will be in the form of POST HTTP request.
http://twitter.com/statuses/update.xml
The main part of the code which is the URL OF THE Twitter API.
Thats all for scripting status update of Twitter. Hope you enjoyed the tutorial.






MultiQuote





|