April 02, 2008
Older: A Few Helpful Helpers
Newer: Update Your Friends iChat Status With A Twitter Direct Message, Simply Because You Can
Twitter Gem Gets STDIN
Jeremy, from my local ruby group, had a sweet idea. He was piping crontab commands into mail and thought “why not use twitter?” He hacked around a bit and sent me some code. I tweaked a couple things and now, as of version 0.2.6, the twitter gem can take stdin when posting from the command line. Below are a few examples from the changelog.
$ twitter post 'test without stdin'
# => twitters: "test without stdin"
$ echo 'test with stdin' | twitter post 'and an argv[1]'
# => twitters: "test with stdin and an argv[1]"
$ echo 'test with stdin without any argv[1]' | twitter post
# => twitters: "test with stdin without any argv[1]"
If you are curious about the implementation, see the bottom of the bin/twitter file.
A Recent Cool Use of the Twitter Gem
Also, while on the topic of twitter, some pals of mine are repurposing the twitter gem to do reviews (and they were even so kind as to update the gem and send a pull request). If you are a twitterer, check out microrevie.ws.
1 Comment
Apr 03, 2008
Nice! :)
Sorry, comments are closed for this article to ease the burden of pruning spam.