Method: Twitter::Client#favorites
- Defined in:
- lib/vendor/twitter/lib/twitter/client/favorites.rb
#favorites(options = nil) ⇒ Object
Provides access to the Twitter list favorites API.
You can access the authenticated [Twitter] user’s favorites list using this method.
By default you will receive the last twenty statuses added to your favorites list. To get a previous page you can provide options to this method. For example,
statuses = client.favorites(:page => 2)
The above one-liner will get the second page of favorites for the authenticated user.
16 17 18 19 20 21 |
# File 'lib/vendor/twitter/lib/twitter/client/favorites.rb', line 16 def favorites( = nil) def uri_suffix(opts); opts && opts[:page] ? "?page=#{opts[:page]}" : ""; end uri = '/favorites.json' + uri_suffix() response = http_connect {|conn| create_http_get_request(uri) } bless_models(Twitter::Status.unmarshal(response.body)) end |