Command-Line Internet
- One minute read - 166 wordsI’m a bit of a command-line junkie. Well, quite a lot of one, actually. So I always like to find ways to do things from the command line, so that I don’t have to wait for a whole GUI application (or worse, a web browser) to load, if I only want to do one thing. Posting tweets is a perfect example — I’d rather just quickly type what’s on my mind and be done with it.
Hence building this script. It’s a quick command-line way of posting a message to Twitter.
#!/bin/bash
/usr/bin/curl --basic --user "user:pass" -w%{http_code}n -o
/dev/null -s --data-ascii "status=`echo $@|tr ' ' '+'`" > "http://twitter.com/statuses/update.json"This should work on any UNIX-family operating system.
I usually use Twitter’s instant message support to receive tweets. Of course, that’s broken at the moment, so my next mission is to work on a way to do that from the command line.
And after that, blogging from the command line!
(Thanks to http://binnyva.blogspot.com/2007/03/using-twitter-part-1-command-line.html for the basic idea)