Didn’t know where else to go for this.
I’m using the twitter gem (https://github.com/sferik/twitter) in a ruby application to do two things: send a tweet and also stream based on 5-10 search terms.
I’m creating different client objects, a REST client for posting an update, and a Stream client for following the hashtags.
Here is the REST Client:
@twitter = Twitter::REST::Client.new do |config|
config.consumer_key = Settings.twitter.c_key
config.consumer_secret = Settings.twitter.c_sec
config.access_token = Settings.twitter.a_tok
config.access_token_secret = Settings.twitter.a_sec
end
Here is the Stream client:
@client = Twitter::Streaming::Client.new do |config|
config.consumer_key = Settings.twitter.c_key
config.consumer_secret = Settings.twitter.c_sec
config.access_token = Settings.twitter.a_tok
config.access_token_secret = Settings.twitter.a_sec
end
Note that the Settings class parameters are the same on both.
This works just fine:
@twitter.update(“foo”)
However this yields an error:
@client.filter(track: [“foo”,“bar”,“john”,“doe”].join(",")) do |object|
case object
when Twitter::Tweet
puts "@#{object.user.screen_name}: #{object.text}"
end
end
{:status_code=>401, :header=>{"WWW-Authenticate"=>"OAuth realm=\"Firehose\"", "Content-Type"=>"text/html", "Cache-Control"=>"must-revalidate,no-cache,no-store", "Transfer-Encoding"=>"chunked"}}
This seemed to work for around 24-48 hours after starting it. My terms list is not the example array above - the frequency of my terms is less than 100 in a 24 hour period. I don’t know where else to turn. Any help?