Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitter API v1.1 #111

Open
jferrercas opened this issue Oct 4, 2012 · 1 comment
Open

Twitter API v1.1 #111

jferrercas opened this issue Oct 4, 2012 · 1 comment

Comments

@jferrercas
Copy link

Hi there

I am updating my app to use Twitter API v1.1

Until now I captured tweets with

# Build a Wrest Uri object
rails_tweet = "https://api.twitter.com/1/statuses/oembed.json?id="
rails_tweet += status.to_s
rails_tweet += "&omit_script=true"
rails_tweet = rails_tweet.to_uri 

# Get it.
response_tweet = rails_tweet.get.deserialise
self.twt_text = response_tweet["html"]

To work with Twitter API v1.1 I have to use https://api.twitter.com/1.1/statuses/show.json?id=210462857140252672

But now all API calls must be signed, so I tried this

# Build a Wrest Uri object
rails_tweet = "https://api.twitter.com/1.1/statuses/show.json?id="
rails_tweet += status.to_s
rails_tweet += "&omit_script=true"
rails_tweet = rails_tweet.to_uri(:consumer_key => 'XXXXXXX', :consumer_secret => 'XXXXXX', :oauth_token => 'XXXXXXXX', :oauth_token_secret => 'XXXXX')

# Get it.
response_tweet = rails_tweet.get.deserialise
self.twt_text = response_tweet["html"]

Obviosly changing values for my app, but it does not work, and I receive 400 Bad Request

Now I am using wrest-1.5.0

Any idea? Thanks

@achamian
Copy link
Contributor

achamian commented Oct 5, 2012

Hi,

I'm looking into it. I'll let you know in by tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants