File: favorites.rb

package info (click to toggle)
ruby-twitter-oauth 0.4.94-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 152 kB
  • sloc: ruby: 446; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module TwitterOAuth
  class Client
    
    # Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter.
    def favorites(page=1)
      get("/favorites.json?page=#{page}")
    end
    
    # Favorites the status specified in the ID parameter as the authenticating user. 
    # Returns the favorite status when successful.
    def favorite(id)
      post("/favorites/create/#{id}.json")
    end
    
    # Un-favorites the status specified in the ID parameter as the authenticating user. 
    # Returns the un-favorited status when successful.
    def unfavorite(id)
      post("/favorites/destroy/#{id}.json")
    end
    
  end
end