Seach tweets with geocode Twitter gem

ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin10.8.0]
gem twitter (4.4.1, 3.7.0)

the gem is this.
https://github.com/sferik/twitter

What I am trying to do is simply to search tweets from geocode.

@client = Twitter::Client.new(
:consumer_key => CONSUMER_KEY,
:consumer_secret => CONSUMER_SECRET,
:oauth_token => OAUTH_TOKEN,
:oauth_token_secret => OAUTH_TOKEN_SECRET
)

longitude = 140.3863
latitude = 35.76472
str = latitude.to_s + ‘,’ + longitude.to_s + ‘, 10km’

p @client.search(:geocode => str ).results

gives an error

/Users/soichi/.rvm/gems/ruby-1.9.3-p286/gems/twitter-4.4.1/lib/twitter/response/raise_error.rb:21:in
on_complete': Could not authenticate you (Twitter::Error::Unauthorized) from /Users/soichi/.rvm/gems/ruby-1.9.3-p286/gems/faraday-0.8.4/lib/faraday/response.rb:9:inblock in call’

But the authentication should be fine because I have tried user_timeline
and got the results as expected.

Do you see the problem in my code?

soichi

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs