Topic: Streaming Twitter API parsing

Hello All, 
I'm using a verry basic Ruby script to parse the streaming Twitter API. Ik works fine for some time, but sometimes a tweet results in:   

2mysqlorg:28: undefined method `[]' for nil:NilClass (NoMethodError)     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:479:in `call'     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:479:in `on_decoded_body_data'     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:472:in `on_body_data'     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:786:in `process_chunk_body'     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:534:in `dispatch'     
from /var/lib/gems/1.8/gems/em-http-request-0.2.15/lib/em-http/client.rb:460:in `receive_data'   
  from /var/lib/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'     
from /var/lib/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'     
from 2mysqlorg:9   
Any ideas? I've posted the script to: http://pastebin.com/3Y81QXrK

Thanks, Roland

Last edited by Rolandklo (2010-12-15 19:56:56)