April 02, 2008
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' # => twitters: "test with stdin and an argv" $ echo 'test with stdin without any argv' | twitter post # => twitters: "test with stdin without any argv"
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.