From: Jesse Crockett Date: 2009-07-15T10:15:56+09:00 Subject: Trying to parse stream.twitter.com, please help. I'm having no luck working on this, and it's my first attempt at such a process. Here is the code as it is now. When I run the file, I'm testing it against my own twitter account, and I see in the '% Received' it gets about 1100 bytes each time I update, but nothing else works beyond that. This is a job qualifier, any help is appreciated. [code] require "rubygems" require "json" BASE = "http://stream.twitter.com/" MODE = "follow.json" USER = "-u----------:-------" USERS = [26079932] IO.popen("curl -d @following #{BASE}#{MODE} #{USER}") do |io| begin while line = io.gets status = line.length > 2 ? JSON.parse(line) : nil if status if status["user"]["screen_name"] == 'my_screen_name' File.new("update_file", 'a').puts "hello" #`echo \"#{status[:user][:id]}\" >> update_file` end end end rescue # connection lost end end [/code] -- Posted via http://www.ruby-forum.com/.