foursquare2 1.9.8 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/foursquare2.gemspec +2 -2
- data/lib/foursquare2/campaigns.rb +10 -8
- data/lib/foursquare2/events.rb +8 -4
- data/lib/foursquare2/lists.rb +10 -6
- data/lib/foursquare2/pages.rb +6 -4
- data/lib/foursquare2/photos.rb +7 -5
- data/lib/foursquare2/settings.rb +12 -8
- data/lib/foursquare2/specials.rb +11 -9
- data/lib/foursquare2/tips.rb +11 -9
- data/lib/foursquare2/users.rb +22 -16
- data/lib/foursquare2/venuegroups.rb +12 -10
- data/lib/foursquare2/venues.rb +40 -22
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/foursquare2.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "foursquare2"
|
8
|
-
s.version = "
|
8
|
+
s.version = "2.0.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Mueller", "Marco Moura"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2014-05-28"
|
13
13
|
s.description = "Gives access to all endpoints in version 2 of foursquare's API with syntax that will be familiar to those who used the original foursquare gem by Jeremy Welch."
|
14
14
|
s.email = ["muellermr@gmail.com", "email@marcomoura.com"]
|
15
15
|
s.extra_rdoc_files = [
|
@@ -4,12 +4,14 @@ module Foursquare2
|
|
4
4
|
# Retrieve information about a campaign
|
5
5
|
#
|
6
6
|
# param [String] campaign_id The ID of the venue
|
7
|
-
def campaign(campaign_id)
|
8
|
-
response = connection.get
|
7
|
+
def campaign(campaign_id, options={})
|
8
|
+
response = connection.get do |req|
|
9
|
+
req.url "campaigns/#{campaign_id}", options
|
10
|
+
end
|
9
11
|
return_error_or_body(response, response.body.response.campaign)
|
10
12
|
end
|
11
|
-
|
12
|
-
# Add a campaign
|
13
|
+
|
14
|
+
# Add a campaign
|
13
15
|
# Details on param options can be found at https://developer.foursquare.com/docs/campaigns/add
|
14
16
|
#
|
15
17
|
# @param [Hash] options
|
@@ -18,7 +20,7 @@ module Foursquare2
|
|
18
20
|
# @option options String :venueId - comma-separated list of venue IDs (either groupId or venueId is required)
|
19
21
|
# @option options Integer :endAt - DateTime when the campaign is to be automatically deactivated (seconds since epoch)
|
20
22
|
# @option options Integer :startAt - DateTime when the campaign is to be started (seconds since epoch)
|
21
|
-
# @option options String :campaignId - ID of an existing campaign to copy.
|
23
|
+
# @option options String :campaignId - ID of an existing campaign to copy.
|
22
24
|
#
|
23
25
|
|
24
26
|
def add_campaign(options={})
|
@@ -52,12 +54,12 @@ module Foursquare2
|
|
52
54
|
#
|
53
55
|
#
|
54
56
|
|
55
|
-
def end_campaign(campaign_id)
|
57
|
+
def end_campaign(campaign_id, options={})
|
56
58
|
response = connection.post do |req|
|
57
|
-
req.url "campaigns/#{campaign_id}/end"
|
59
|
+
req.url "campaigns/#{campaign_id}/end", options
|
58
60
|
end
|
59
61
|
return_error_or_body(response, response.body.code)
|
60
62
|
end
|
61
|
-
|
63
|
+
|
62
64
|
end
|
63
65
|
end
|
data/lib/foursquare2/events.rb
CHANGED
@@ -5,15 +5,19 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# param [String] event_id The ID of the event
|
7
7
|
|
8
|
-
def event(event_id)
|
9
|
-
response = connection.get
|
8
|
+
def event(event_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "events/#{event_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.event)
|
11
13
|
end
|
12
14
|
|
13
15
|
# Retrieve information about all event categories.
|
14
16
|
|
15
|
-
def event_categories
|
16
|
-
response = connection.get
|
17
|
+
def event_categories(options={})
|
18
|
+
response = connection.get do |req|
|
19
|
+
req.url "events/categories", options
|
20
|
+
end
|
17
21
|
return_error_or_body(response, response.body.response.categories)
|
18
22
|
end
|
19
23
|
|
data/lib/foursquare2/lists.rb
CHANGED
@@ -34,8 +34,10 @@ module Foursquare2
|
|
34
34
|
#
|
35
35
|
# @param [String] list_id - The id of the list to follow.
|
36
36
|
|
37
|
-
def follow_list(list_id)
|
38
|
-
response = connection.post
|
37
|
+
def follow_list(list_id, options={})
|
38
|
+
response = connection.post do |req|
|
39
|
+
req.url "lists/#{list_id}/follow", options
|
40
|
+
end
|
39
41
|
return_error_or_body(response, response.body.response.list)
|
40
42
|
end
|
41
43
|
|
@@ -43,8 +45,10 @@ module Foursquare2
|
|
43
45
|
#
|
44
46
|
# @param [String] list_id - The id of the list to unfollow.
|
45
47
|
|
46
|
-
def unfollow_list(list_id)
|
47
|
-
response = connection.post
|
48
|
+
def unfollow_list(list_id, options={})
|
49
|
+
response = connection.post do |req|
|
50
|
+
req.url "lists/#{list_id}/unfollow", options
|
51
|
+
end
|
48
52
|
return_error_or_body(response, response.body.response.list)
|
49
53
|
end
|
50
54
|
|
@@ -87,9 +91,9 @@ module Foursquare2
|
|
87
91
|
# @param [String] list_id - The id of the list to delete item from
|
88
92
|
# @param [String] item_id = The id of the item to delete from list
|
89
93
|
|
90
|
-
def delete_list_item(list_id, item_id)
|
94
|
+
def delete_list_item(list_id, item_id, options={})
|
91
95
|
response = connection.post do |req|
|
92
|
-
req.url "lists/#{list_id}/deleteitem", :itemId => item_id
|
96
|
+
req.url "lists/#{list_id}/deleteitem", {:itemId => item_id}.merge(options)
|
93
97
|
end
|
94
98
|
return_error_or_body(response, response.body.response.item)
|
95
99
|
end
|
data/lib/foursquare2/pages.rb
CHANGED
@@ -6,8 +6,10 @@ module Foursquare2
|
|
6
6
|
# /!\ A page is considered by Foursquare as a user.
|
7
7
|
# @param [Integer] user_id - Page to get information for.
|
8
8
|
|
9
|
-
def page(user_id)
|
10
|
-
response = connection.get
|
9
|
+
def page(user_id, options={})
|
10
|
+
response = connection.get do |req|
|
11
|
+
req.url "pages/#{user_id}", options
|
12
|
+
end
|
11
13
|
return_error_or_body(response, response.body.response.user)
|
12
14
|
end
|
13
15
|
|
@@ -35,9 +37,9 @@ module Foursquare2
|
|
35
37
|
# @option options Integer :offset - For paging through results
|
36
38
|
# @option options String :ll - Latitude and longitude in format LAT,LON - Limit results to venues near this latitude and longitude. NOT VALID with NE or SW (see after).
|
37
39
|
# @option String :radius - Can be used when including ll. Limit results to venues within this many meters of the specified ll. Not valid with ne or sw.
|
38
|
-
# @option String :sw - With ne, limits results to the bounding quadrangle defined by the latitude and longitude given by sw as its south-west corner, and ne as its north-east corner. Not valid with ll or radius.
|
40
|
+
# @option String :sw - With ne, limits results to the bounding quadrangle defined by the latitude and longitude given by sw as its south-west corner, and ne as its north-east corner. Not valid with ll or radius.
|
39
41
|
# @option String :ne - See sw
|
40
|
-
|
42
|
+
|
41
43
|
def page_venues(page_id, options={})
|
42
44
|
response = connection.get do |req|
|
43
45
|
req.url "pages/#{page_id}/venues", options
|
data/lib/foursquare2/photos.rb
CHANGED
@@ -5,10 +5,12 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# @params [String] photo_id - The ID of the photo
|
7
7
|
|
8
|
-
def photo(photo_id)
|
9
|
-
response = connection.get
|
8
|
+
def photo(photo_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "photos/#{photo_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.photo)
|
11
|
-
end
|
13
|
+
end
|
12
14
|
|
13
15
|
# Add a photo
|
14
16
|
#
|
@@ -26,7 +28,7 @@ module Foursquare2
|
|
26
28
|
response = connection.post('photos/add', options)
|
27
29
|
return_error_or_body(response, response.body.response.photo)
|
28
30
|
end
|
29
|
-
|
31
|
+
|
30
32
|
# Retrieve photos for a venue
|
31
33
|
#
|
32
34
|
# @params [String] venue_id - The ID of the venue
|
@@ -40,7 +42,7 @@ module Foursquare2
|
|
40
42
|
end
|
41
43
|
return_error_or_body(response, response.body.response.photos)
|
42
44
|
end
|
43
|
-
|
45
|
+
|
44
46
|
end
|
45
47
|
end
|
46
48
|
|
data/lib/foursquare2/settings.rb
CHANGED
@@ -3,17 +3,21 @@ module Foursquare2
|
|
3
3
|
|
4
4
|
# Retrive all settings for the authenticated user.
|
5
5
|
|
6
|
-
def settings
|
7
|
-
response = connection.get
|
6
|
+
def settings(options={})
|
7
|
+
response = connection.get do |req|
|
8
|
+
req.url "settings/all", options
|
9
|
+
end
|
8
10
|
return_error_or_body(response, response.body.response.settings)
|
9
|
-
end
|
11
|
+
end
|
10
12
|
|
11
13
|
# Retrieve a single setting for the authenticated user.
|
12
14
|
#
|
13
15
|
# @param [String] setting - The name of the setting to retrieve, one of sendtotwitter, sendtofacebook, pings.
|
14
16
|
|
15
|
-
def setting(setting)
|
16
|
-
response = connection.get
|
17
|
+
def setting(setting, options={})
|
18
|
+
response = connection.get do |req|
|
19
|
+
req.url "settings/setting", options
|
20
|
+
end
|
17
21
|
return_error_or_body(response, response.body.response)
|
18
22
|
end
|
19
23
|
|
@@ -22,13 +26,13 @@ module Foursquare2
|
|
22
26
|
# @param [String] setting - The name of the setting to update, one of sendtotwitter, sendtofacebook, pings.
|
23
27
|
# @param [String] value - One of '1','0'
|
24
28
|
|
25
|
-
def update_setting(setting,value)
|
29
|
+
def update_setting(setting, value, options={})
|
26
30
|
response = connection.post do |req|
|
27
|
-
req.url "settings/#{setting}/set", {:value => value}
|
31
|
+
req.url "settings/#{setting}/set", {:value => value}.merge(options)
|
28
32
|
end
|
29
33
|
return_error_or_body(response, response.body.response)
|
30
34
|
end
|
31
|
-
|
35
|
+
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
data/lib/foursquare2/specials.rb
CHANGED
@@ -5,10 +5,12 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# param [String] special_id The ID of the special
|
7
7
|
|
8
|
-
def special(special_id)
|
9
|
-
response = connection.get
|
8
|
+
def special(special_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "specials/#{special_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.special)
|
11
|
-
end
|
13
|
+
end
|
12
14
|
|
13
15
|
# Search for specials
|
14
16
|
#
|
@@ -25,7 +27,7 @@ module Foursquare2
|
|
25
27
|
end
|
26
28
|
return_error_or_body(response, response.body.response.specials.items)
|
27
29
|
end
|
28
|
-
|
30
|
+
|
29
31
|
# Add a special for venue managers
|
30
32
|
# Details on param options can be found at https://developer.foursquare.com/docs/specials/add
|
31
33
|
#
|
@@ -33,10 +35,10 @@ module Foursquare2
|
|
33
35
|
# @option options String :name - A name for the special.
|
34
36
|
# @option options String :text - Required
|
35
37
|
# @option options String :unlockedText - Required. Special text that is shown when the user has unlocked the special.
|
36
|
-
# @option options String :finePrint
|
37
|
-
# @option options Integer :count1
|
38
|
-
# @option options Integer :count2
|
39
|
-
# @option options Integer :count3
|
38
|
+
# @option options String :finePrint
|
39
|
+
# @option options Integer :count1
|
40
|
+
# @option options Integer :count2
|
41
|
+
# @option options Integer :count3
|
40
42
|
# @option options String :type - Required.
|
41
43
|
# @option options String :offerId
|
42
44
|
# @option options Float :cost
|
@@ -48,7 +50,7 @@ module Foursquare2
|
|
48
50
|
end
|
49
51
|
return_error_or_body(response, response.body.response.special)
|
50
52
|
end
|
51
|
-
|
53
|
+
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
data/lib/foursquare2/tips.rb
CHANGED
@@ -5,10 +5,12 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# param [String] tip_id - The id of the tip to retrieve.
|
7
7
|
|
8
|
-
def tip(tip_id)
|
9
|
-
response = connection.get
|
8
|
+
def tip(tip_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "tips/#{tip_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.tip)
|
11
|
-
end
|
13
|
+
end
|
12
14
|
|
13
15
|
# Search for tips.
|
14
16
|
#
|
@@ -63,9 +65,9 @@ module Foursquare2
|
|
63
65
|
#
|
64
66
|
# param [String] tip_id - The id of the tip to mark.
|
65
67
|
|
66
|
-
def mark_tip_todo(tip_id)
|
68
|
+
def mark_tip_todo(tip_id, options={})
|
67
69
|
response = connection.post do |req|
|
68
|
-
req.url "tips/#{tip_id}/marktodo"
|
70
|
+
req.url "tips/#{tip_id}/marktodo", options
|
69
71
|
end
|
70
72
|
return_error_or_body(response, response.body.response)
|
71
73
|
end
|
@@ -74,9 +76,9 @@ module Foursquare2
|
|
74
76
|
#
|
75
77
|
# param [String] tip_id - The id of the tip to mark.
|
76
78
|
|
77
|
-
def mark_tip_done(tip_id)
|
79
|
+
def mark_tip_done(tip_id, options={})
|
78
80
|
response = connection.post do |req|
|
79
|
-
req.url "tips/#{tip_id}/markdone"
|
81
|
+
req.url "tips/#{tip_id}/markdone", options
|
80
82
|
end
|
81
83
|
return_error_or_body(response, response.body.response)
|
82
84
|
end
|
@@ -85,9 +87,9 @@ module Foursquare2
|
|
85
87
|
#
|
86
88
|
# param [String] tip_id - The id of the tip to unmark.
|
87
89
|
|
88
|
-
def unmark_tip(tip_id)
|
90
|
+
def unmark_tip(tip_id, options={})
|
89
91
|
response = connection.post do |req|
|
90
|
-
req.url "tips/#{tip_id}/unmark"
|
92
|
+
req.url "tips/#{tip_id}/unmark", options
|
91
93
|
end
|
92
94
|
return_error_or_body(response, response.body.response)
|
93
95
|
end
|
data/lib/foursquare2/users.rb
CHANGED
@@ -17,8 +17,10 @@ module Foursquare2
|
|
17
17
|
#
|
18
18
|
# @param [Integer] user_id - User to get information for.
|
19
19
|
|
20
|
-
def user(user_id)
|
21
|
-
response = connection.get
|
20
|
+
def user(user_id, options={})
|
21
|
+
response = connection.get do |req|
|
22
|
+
req.url "users/#{user_id}", options
|
23
|
+
end
|
22
24
|
return_error_or_body(response, response.body.response.user)
|
23
25
|
end
|
24
26
|
|
@@ -65,8 +67,10 @@ module Foursquare2
|
|
65
67
|
end
|
66
68
|
# Get all pending friend requests for the authenticated user
|
67
69
|
|
68
|
-
def user_requests
|
69
|
-
response = connection.get
|
70
|
+
def user_requests(options={})
|
71
|
+
response = connection.get do |req|
|
72
|
+
req.url "users/requests", options
|
73
|
+
end
|
70
74
|
return_error_or_body(response, response.body.response.requests)
|
71
75
|
end
|
72
76
|
|
@@ -74,8 +78,10 @@ module Foursquare2
|
|
74
78
|
#
|
75
79
|
# @param [String] user_id - The user to retrieve badges for.
|
76
80
|
|
77
|
-
def user_badges(user_id)
|
78
|
-
response = connection.get
|
81
|
+
def user_badges(user_id, options={})
|
82
|
+
response = connection.get do |req|
|
83
|
+
req.url "users/#{user_id}/badges", options
|
84
|
+
end
|
79
85
|
return_error_or_body(response, response.body.response)
|
80
86
|
end
|
81
87
|
|
@@ -174,9 +180,9 @@ module Foursquare2
|
|
174
180
|
#
|
175
181
|
# @param [String] user_id - The user to retrieve friends for.
|
176
182
|
|
177
|
-
def user_mayorships(user_id)
|
183
|
+
def user_mayorships(user_id, options={})
|
178
184
|
response = connection.get do |req|
|
179
|
-
|
185
|
+
req.url "users/#{user_id}/mayorships", options
|
180
186
|
end
|
181
187
|
return_error_or_body(response, response.body.response.mayorships)
|
182
188
|
end
|
@@ -199,9 +205,9 @@ module Foursquare2
|
|
199
205
|
#
|
200
206
|
# @param [String] user_id - The user to request friendship with.
|
201
207
|
|
202
|
-
def user_friend_request(user_id)
|
208
|
+
def user_friend_request(user_id, options={})
|
203
209
|
response = connection.post do |req|
|
204
|
-
req.url "users/#{user_id}/request"
|
210
|
+
req.url "users/#{user_id}/request", options
|
205
211
|
end
|
206
212
|
return_error_or_body(response, response.body.response)
|
207
213
|
end
|
@@ -210,9 +216,9 @@ module Foursquare2
|
|
210
216
|
#
|
211
217
|
# @param [String] user_id - The user to unfriend.
|
212
218
|
|
213
|
-
def user_unfriend(user_id)
|
219
|
+
def user_unfriend(user_id, options={})
|
214
220
|
response = connection.post do |req|
|
215
|
-
req.url "users/#{user_id}/unfriend"
|
221
|
+
req.url "users/#{user_id}/unfriend", options
|
216
222
|
end
|
217
223
|
return_error_or_body(response, response.body.response)
|
218
224
|
end
|
@@ -221,9 +227,9 @@ module Foursquare2
|
|
221
227
|
#
|
222
228
|
# @param [String] user_id - The user to approve friendship with.
|
223
229
|
|
224
|
-
def user_approve_friend(user_id)
|
230
|
+
def user_approve_friend(user_id, options={})
|
225
231
|
response = connection.post do |req|
|
226
|
-
req.url "users/#{user_id}/approve"
|
232
|
+
req.url "users/#{user_id}/approve", options
|
227
233
|
end
|
228
234
|
return_error_or_body(response, response.body.response)
|
229
235
|
end
|
@@ -232,9 +238,9 @@ module Foursquare2
|
|
232
238
|
#
|
233
239
|
# @param [String] user_id - The user to deny friendship with.
|
234
240
|
|
235
|
-
def user_deny_friend(user_id)
|
241
|
+
def user_deny_friend(user_id, options={})
|
236
242
|
response = connection.post do |req|
|
237
|
-
req.url "users/#{user_id}/deny"
|
243
|
+
req.url "users/#{user_id}/deny", options
|
238
244
|
end
|
239
245
|
return_error_or_body(response, response.body.response)
|
240
246
|
end
|
@@ -5,18 +5,20 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# param [String] group_id The ID of the venuegroup
|
7
7
|
|
8
|
-
def venuegroup(group_id)
|
9
|
-
response = connection.get
|
8
|
+
def venuegroup(group_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "venuegroups/#{group_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.venueGroup)
|
11
13
|
end
|
12
14
|
|
13
|
-
# Create a venue group. If the venueId parameter is specified,
|
14
|
-
# then the endpoint will add the specified venues to the venue group.
|
15
|
-
# If it is not possible to add all of the specified venues to the group,
|
15
|
+
# Create a venue group. If the venueId parameter is specified,
|
16
|
+
# then the endpoint will add the specified venues to the venue group.
|
17
|
+
# If it is not possible to add all of the specified venues to the group,
|
16
18
|
# then creation of the venue group will fail entirely.
|
17
19
|
# @param [Hash] options
|
18
20
|
# @option options String :name - Required. The name to give the group.
|
19
|
-
# @option options String :venueId - Comma-delimited list of venue IDs to add to the group. If this parameter is not specified, then the venue group will initially be empty.
|
21
|
+
# @option options String :venueId - Comma-delimited list of venue IDs to add to the group. If this parameter is not specified, then the venue group will initially be empty.
|
20
22
|
|
21
23
|
def add_venuegroup(options={})
|
22
24
|
response = connection.post do |req|
|
@@ -41,9 +43,9 @@ module Foursquare2
|
|
41
43
|
|
42
44
|
# List all venue groups owned by the user.
|
43
45
|
|
44
|
-
def list_venuegroup
|
46
|
+
def list_venuegroup(options={})
|
45
47
|
response = connection.get do |req|
|
46
|
-
req.url "venuegroups/list"
|
48
|
+
req.url "venuegroups/list", options
|
47
49
|
end
|
48
50
|
return_error_or_body(response, response.body.response.venueGroups)
|
49
51
|
end
|
@@ -51,9 +53,9 @@ module Foursquare2
|
|
51
53
|
# Delete a venue group.
|
52
54
|
# param [String] group_id - The ID of the venuegroup to delete.
|
53
55
|
|
54
|
-
def delete_venuegroup(group_id)
|
56
|
+
def delete_venuegroup(group_id, options={})
|
55
57
|
response = connection.post do |req|
|
56
|
-
req.url "venuegroups/#{group_id}/delete"
|
58
|
+
req.url "venuegroups/#{group_id}/delete", options
|
57
59
|
end
|
58
60
|
return_error_or_body(response, response.body.response)
|
59
61
|
end
|
data/lib/foursquare2/venues.rb
CHANGED
@@ -5,8 +5,10 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# param [String] venue_id The ID of the venue
|
7
7
|
|
8
|
-
def venue(venue_id)
|
9
|
-
response = connection.get
|
8
|
+
def venue(venue_id, options={})
|
9
|
+
response = connection.get do |req|
|
10
|
+
req.url "venues/#{venue_id}", options
|
11
|
+
end
|
10
12
|
return_error_or_body(response, response.body.response.venue)
|
11
13
|
end
|
12
14
|
|
@@ -27,7 +29,7 @@ module Foursquare2
|
|
27
29
|
end
|
28
30
|
return_error_or_body(response, response.body.response)
|
29
31
|
end
|
30
|
-
|
32
|
+
|
31
33
|
# Search for trending venues
|
32
34
|
#
|
33
35
|
# @param [String] :ll Latitude and longitude in format LAT,LON
|
@@ -36,7 +38,7 @@ module Foursquare2
|
|
36
38
|
# @option options Integer :radius - Radius in meters, up to approximately 2000 meters.
|
37
39
|
|
38
40
|
def trending_venues(ll, options={})
|
39
|
-
options[:ll] = ll
|
41
|
+
options[:ll] = ll
|
40
42
|
response = connection.get do |req|
|
41
43
|
req.url "venues/trending", options
|
42
44
|
end
|
@@ -63,8 +65,10 @@ module Foursquare2
|
|
63
65
|
|
64
66
|
# Retrieve information about all venue categories.
|
65
67
|
|
66
|
-
def venue_categories
|
67
|
-
response = connection.get
|
68
|
+
def venue_categories(options={})
|
69
|
+
response = connection.get do |req|
|
70
|
+
req.url "venues/categories", options
|
71
|
+
end
|
68
72
|
return_error_or_body(response, response.body.response.categories)
|
69
73
|
end
|
70
74
|
|
@@ -72,8 +76,10 @@ module Foursquare2
|
|
72
76
|
#
|
73
77
|
# param [String] venue_id The ID of the venue
|
74
78
|
|
75
|
-
def venue_links(venue_id)
|
76
|
-
response = connection.get
|
79
|
+
def venue_links(venue_id, options={})
|
80
|
+
response = connection.get do |req|
|
81
|
+
req.url "venues/#{venue_id}/links", options
|
82
|
+
end
|
77
83
|
return_error_or_body(response, response.body.response.links)
|
78
84
|
end
|
79
85
|
|
@@ -209,8 +215,10 @@ module Foursquare2
|
|
209
215
|
#
|
210
216
|
# param [String] venue_id The ID of the venue
|
211
217
|
|
212
|
-
def venue_menus(venue_id)
|
213
|
-
response = connection.get
|
218
|
+
def venue_menus(venue_id, options={})
|
219
|
+
response = connection.get do |req|
|
220
|
+
req.url "venues/#{venue_id}/menu", options
|
221
|
+
end
|
214
222
|
return_error_or_body(response, response.body.response)
|
215
223
|
end
|
216
224
|
|
@@ -233,9 +241,9 @@ module Foursquare2
|
|
233
241
|
#Returns a list of venues managed
|
234
242
|
#
|
235
243
|
|
236
|
-
def managed_venues()
|
244
|
+
def managed_venues(options={})
|
237
245
|
response = connection.get do |req|
|
238
|
-
req.url "venues/managed"
|
246
|
+
req.url "venues/managed", options
|
239
247
|
end
|
240
248
|
return_error_or_body(response, response.body.response.venues)
|
241
249
|
end
|
@@ -276,8 +284,10 @@ module Foursquare2
|
|
276
284
|
#
|
277
285
|
# param [String] venue_id The ID of the venue
|
278
286
|
|
279
|
-
def venue_hours(venue_id)
|
280
|
-
response = connection.get
|
287
|
+
def venue_hours(venue_id, options={})
|
288
|
+
response = connection.get do |req|
|
289
|
+
req.url "venues/#{venue_id}/hours", options
|
290
|
+
end
|
281
291
|
return_error_or_body(response, response.body.response)
|
282
292
|
end
|
283
293
|
|
@@ -285,8 +295,10 @@ module Foursquare2
|
|
285
295
|
#
|
286
296
|
# param [String] venue_id The ID of the venue
|
287
297
|
|
288
|
-
def venue_events(venue_id)
|
289
|
-
response = connection.get
|
298
|
+
def venue_events(venue_id, options={})
|
299
|
+
response = connection.get do |req|
|
300
|
+
req.url "venues/#{venue_id}/events", options
|
301
|
+
end
|
290
302
|
return_error_or_body(response, response.body.response)
|
291
303
|
end
|
292
304
|
|
@@ -294,8 +306,10 @@ module Foursquare2
|
|
294
306
|
#
|
295
307
|
# param [String] venue_id The ID of the venue to get likes for
|
296
308
|
|
297
|
-
def venue_likes(venue_id)
|
298
|
-
response = connection.get
|
309
|
+
def venue_likes(venue_id, options={})
|
310
|
+
response = connection.get do |req|
|
311
|
+
req.url "venues/#{venue_id}/likes", options
|
312
|
+
end
|
299
313
|
return_error_or_body(response, response.body.response)
|
300
314
|
end
|
301
315
|
|
@@ -317,8 +331,10 @@ module Foursquare2
|
|
317
331
|
#
|
318
332
|
# param [String] venue_id Required. ID of the venue you want to see next venue information about
|
319
333
|
|
320
|
-
def venue_nextvenues(venue_id)
|
321
|
-
response = connection.get
|
334
|
+
def venue_nextvenues(venue_id, options={})
|
335
|
+
response = connection.get do |req|
|
336
|
+
req.url "venues/#{venue_id}/nextvenues", options
|
337
|
+
end
|
322
338
|
return_error_or_body(response, response.body.response)
|
323
339
|
end
|
324
340
|
|
@@ -326,8 +342,10 @@ module Foursquare2
|
|
326
342
|
#
|
327
343
|
# param [String] venue_id The venue you want similar venues for.
|
328
344
|
|
329
|
-
def venue_similar(venue_id)
|
330
|
-
response = connection.get
|
345
|
+
def venue_similar(venue_id, options={})
|
346
|
+
response = connection.get do |req|
|
347
|
+
req.url "venues/#{venue_id}/similar", options
|
348
|
+
end
|
331
349
|
return_error_or_body(response, response.body.response)
|
332
350
|
end
|
333
351
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foursquare2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2014-05-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -339,7 +339,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
339
339
|
version: '0'
|
340
340
|
segments:
|
341
341
|
- 0
|
342
|
-
hash:
|
342
|
+
hash: -1615806452877883596
|
343
343
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
344
344
|
none: false
|
345
345
|
requirements:
|