Created
December 28, 2011 23:57
-
-
Save maknoll/1530540 to your computer and use it in GitHub Desktop.
parses json twitter objects from stdin and prints to stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
while line = gets | |
if json = line.match(/\{.*\}/) | |
tweet = JSON.parse(json[0], :symbolize_names => true) | |
puts "@#{tweet[:user][:screen_name]}: #{tweet[:text]}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment