I've been doing a lot of things with the Twitter API lately. More on that another time though. I started messing around with their stream API last night. It's pretty fun to play with and I wanted to put the code up somewhere so I can use it later. Right now it works, but it clearly isn't very robust. It needs retry logic and better error handling. Right now, it's just a toy :)
You'll need the json gem installed. Once you have that you can run the script like...
./twitter_stream.rb <username> <password>