hayesdavis / grackle

Lightweight Ruby library for the Twitter API that goes with the flow.
228 stars 36 forks source link

Passing in `id` param to a query puts it in the URL rather than as actual param. #30

Closed messick closed 11 years ago

messick commented 11 years ago

The oembed part of the 1.1 Twitter API can take param named id. If it's passed in, then it becomes part of the URL like so:

21] pry(main)> client.statuses.oembed.json? maxwidth: 500, id: "337793757426614272"
Grackle::TwitterError: get http://api.twitter.com/1.1/statuses/oembed/337793757426614272.json?maxwidth=500 => 404: {"errors":[{"message":"Sorry, that page does not exist"...
hayesdavis commented 11 years ago

There's actually a flag you can pass into the Grackle::Client constructor called :auto_append_ids. Set this to false and it won't automatically insert the id like that. Sorry for the lack of documentation.

See here: https://github.com/hayesdavis/grackle/blob/master/lib/grackle/client.rb#L145