Class: Foursquare::User

Inherits:
Node
  • Object
show all
Defined in:
lib/foursquare_user.rb

Instance Method Summary collapse

Methods inherited from Node

#initialize, #perform_graph_request

Constructor Details

This class inherits a constructor from Foursquare::Node

Instance Method Details

#approve(user_id) ⇒ Object



64
65
66
# File 'lib/foursquare_user.rb', line 64

def approve(user_id)
  perform_graph_request("users/#{user_id}/approve", {}, "post")
end

#badges(user_id) ⇒ Object

Aspects



20
21
22
# File 'lib/foursquare_user.rb', line 20

def badges(user_id)
  perform_graph_request("users/#{user_id}/badges")
end

#checkins(user_id = "self", params = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/foursquare_user.rb', line 24

def checkins(user_id="self", params={})
  params = {:limit => 100,
            :offset => 0,
            :afterTimestamp => "",
            :beforeTimestamp => ""}.merge!(params)

  perform_graph_request("users/#{user_id}/checkins", params)
end

#deny(user_id) ⇒ Object



68
69
70
# File 'lib/foursquare_user.rb', line 68

def deny(user_id)
  perform_graph_request("users/#{user_id}/deny", {}, "post")
end

#friends(user_id = "self") ⇒ Object



33
34
35
# File 'lib/foursquare_user.rb', line 33

def friends(user_id="self")
  perform_graph_request("users/#{user_id}/friends")
end

#request(user_id) ⇒ Object

Actions



56
57
58
# File 'lib/foursquare_user.rb', line 56

def request(user_id)
  perform_graph_request("users/#{user_id}/request", {}, "post")
end

#requestsObject



15
16
17
# File 'lib/foursquare_user.rb', line 15

def requests
  perform_graph_request("users/requests")
end

#search(params = {}) ⇒ Object

General



4
5
6
7
8
9
10
11
12
13
# File 'lib/foursquare_user.rb', line 4

def search(params={})
  params = {:phone => "",
            :email => "",
            :twitter => "",
            :twitterSource => "",
            :fbid => "",
            :name => ""}.merge!(params)

  perform_graph_request("users/search", params)
end

#setpings(user_id, params = {}) ⇒ Object



72
73
74
75
76
# File 'lib/foursquare_user.rb', line 72

def setpings(user_id, params={})
  params = {:value => "true"}.merge!(params)
  
  perform_graph_request("users/#{user_id}/setpings", params, "post")
end

#tips(user_id = "self", params = {}) ⇒ Object



37
38
39
40
41
42
# File 'lib/foursquare_user.rb', line 37

def tips(user_id="self", params={})
  params = {:sort => "recent",
            :ll => "37.792694,-122.409325"}.merge!(params)

  perform_graph_request("users/#{user_id}/tips", params)
end

#todos(user_id = "self", params = {}) ⇒ Object



44
45
46
47
48
49
# File 'lib/foursquare_user.rb', line 44

def todos(user_id="self", params={})
  params = {:sort => "recent",
            :ll => "37.792694,-122.409325"}.merge!(params)

  perform_graph_request("users/#{user_id}/todos", params)
end

#unfriend(user_id) ⇒ Object



60
61
62
# File 'lib/foursquare_user.rb', line 60

def unfriend(user_id)
  perform_graph_request("users/#{user_id}/unfriend", {}, "post")
end

#venuehistory(user_id = "self") ⇒ Object



51
52
53
# File 'lib/foursquare_user.rb', line 51

def venuehistory(user_id="self")
  perform_graph_request("users/#{user_id}/venuehistory")
end