wwchen / FootTraffic

A CSCE 470 production, presented by wwchen and eric_wood
http://courses.cse.tamu.edu/caverlee/csce470/project.html
1 stars 0 forks source link

Start coding to pull in twitter data #6

Open wwchen opened 12 years ago

wwchen commented 12 years ago

Complete, though it is a little buggy.

TODO

:delete    => Proc.new { |status_id, user_id|
  # FIXME do something
},
:limit     => Proc.new { |skip_count|
  # FIXME do something
},
:error     => Proc.new { |message|
  # FIXME do something
},
:reconnect => Proc.new { |timeout, retries|
  # FIXME do something
}
TweetStream::Client.new.locations([-123,36,-121,38],

to

TweetStream::Daemon.new.locations([-123,36,-121,38],

the script throws a hissy fist:

/home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `<<': Could not parse data entirely (HTTP::Parser::Error)
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/twitter-stream-0.1.14/lib/twitter/json_stream.rb:121:in `receive_data'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:338:in `start'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/tweetstream-1.1.3/lib/tweetstream/daemon.rb:49:in `block in start'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/application.rb:249:in `call'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/application.rb:249:in `block in start_proc'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/application.rb:260:in `call'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/application.rb:260:in `start_proc'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/application.rb:293:in `start'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/controller.rb:73:in `run'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons.rb:195:in `block in run_proc'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/cmdline.rb:109:in `call'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons/cmdline.rb:109:in `catch_exceptions'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/daemons-1.1.4/lib/daemons.rb:194:in `run_proc'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/tweetstream-1.1.3/lib/tweetstream/daemon.rb:48:in `start'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:122:in `filter'
        from /home/wchen/.rvm/gems/ruby-1.9.3-p0/gems/tweetstream-1.1.3/lib/tweetstream/client.rb:113:in `locations'
        from script/get_tweets:19:in `<main>'

The script is in script/get_tweets.