Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Twitter and Jaiku from the command line (See related posts)

The following instructions make it easy to post to Twitter and Jaiku from the command line. The instructions were copied from the article "Ubuntu Unleashed: Howto Twitter From the Command Line in Ubuntu!" [ubuntu-unleashed.com] and modified to post via Rorbuilder's ProjectX API.

   1  sudo apt-get install curl

   1  sudo gedit /usr/bin/jaitwit

Now Paste this in gEdit and simply replace "YourUsername" with your username and "YourPassword" with your twitter passwd, then replace the Jaiku variables (YourUsername, YourPassword, YourCity, YourAccessKey) and ctrl-s to save, then alt-F4 to exit!
   1  
   2  curl http://rorbuilder.info/api/projectx.cgi?xml_project=%3Cproject%20name=%22micro_blog%22%3E%3Cmethods%3E%3Cmethod%20name=%22post2jaiku%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22location%22%20val=%22YourCity%22/%3E%3Cparam%20var=%22apikey%22%20val=%22YourAccessKey%22/%3E%3C/params%3E%3C/method%3E%3Cmethod%20name=%22post2twitter%22%3E%3Cparams%3E%3Cparam%20var=%22user%22%20val=%22YourUsername%22/%3E%3Cparam%20var=%22msg%22%20val=%22`echo $@|tr ' ' '+'`%22/%3E%3Cparam%20var=%22password%22%20val=%22YourPassword%22/%3E%3C/params%3E%3C/method%3E%3C/methods%3E%3C/project%3E -o /dev/null
   3  echo Message Sent!

Then chmod for exec privileges:
   1  chmod +x /usr/bin/jaitwit

Then from the CLI type jaitwit followed by your message.
   1  jaitwit "message here without the quotes"

You need to create an account or log in to post comments to this site.


Click here to browse all 5545 code snippets

Related Posts