Skip to content

Twitter API v1.1 #111

@jferrercas

Description

@jferrercas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions