foursquare2 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Readme.md +1 -0
- data/VERSION +1 -1
- data/foursquare2.gemspec +4 -2
- data/lib/foursquare2/pages.rb +12 -0
- data/lib/foursquare2/venues.rb +2 -1
- data/test/fixtures/pages/managed_pages.json +40 -0
- data/test/fixtures/venues/edit_venue.json +83 -0
- data/test/test_pages.rb +7 -0
- data/test/test_venues.rb +6 -0
- metadata +5 -3
data/Readme.md
CHANGED
@@ -112,6 +112,7 @@ See [the documentation](http://rubydoc.info/gems/foursquare2/frames) or [foursqu
|
|
112
112
|
client.search_pages
|
113
113
|
client.herenow
|
114
114
|
client.page_venues
|
115
|
+
client.managed_pages
|
115
116
|
client.search_venues
|
116
117
|
client.search_venues_by_tip
|
117
118
|
client.venue_categories
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
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 = "2.0.
|
8
|
+
s.version = "2.0.1"
|
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 = "2014-
|
12
|
+
s.date = "2014-08-13"
|
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 = [
|
@@ -57,6 +57,7 @@ Gem::Specification.new do |s|
|
|
57
57
|
"test/fixtures/lists/list_item.json",
|
58
58
|
"test/fixtures/lists/list_moved_item.json",
|
59
59
|
"test/fixtures/lists/list_updated.json",
|
60
|
+
"test/fixtures/pages/managed_pages.json",
|
60
61
|
"test/fixtures/pages/page.json",
|
61
62
|
"test/fixtures/pages/page_venues.json",
|
62
63
|
"test/fixtures/pages/search_pages.json",
|
@@ -81,6 +82,7 @@ Gem::Specification.new do |s|
|
|
81
82
|
"test/fixtures/venuegroups/venuegroup.json",
|
82
83
|
"test/fixtures/venuegroups/venuegroup_add.json",
|
83
84
|
"test/fixtures/venuegroups/venuegroup_update.json",
|
85
|
+
"test/fixtures/venues/edit_venue.json",
|
84
86
|
"test/fixtures/venues/explore_venues.json",
|
85
87
|
"test/fixtures/venues/managed_venues.json",
|
86
88
|
"test/fixtures/venues/no_venues_by_tip.json",
|
data/lib/foursquare2/pages.rb
CHANGED
@@ -48,5 +48,17 @@ module Foursquare2
|
|
48
48
|
venues = Foursquare2.filter(venues, options[:query]) if options.has_key? :query
|
49
49
|
venues
|
50
50
|
end
|
51
|
+
|
52
|
+
|
53
|
+
#
|
54
|
+
# Returns a list of managed pages.
|
55
|
+
#
|
56
|
+
|
57
|
+
def managed_pages(options={})
|
58
|
+
response = connection.get do |req|
|
59
|
+
req.url "pages/managing", options
|
60
|
+
end
|
61
|
+
return_error_or_body(response, response.body.response.managing)
|
62
|
+
end
|
51
63
|
end
|
52
64
|
end
|
data/lib/foursquare2/venues.rb
CHANGED
@@ -168,7 +168,8 @@ module Foursquare2
|
|
168
168
|
|
169
169
|
def edit_venue(venue_id, options={})
|
170
170
|
response = connection.post do |req|
|
171
|
-
req.
|
171
|
+
req.body = options
|
172
|
+
req.url "venues/#{venue_id}/proposeedit"
|
172
173
|
end
|
173
174
|
return_error_or_body(response, response.body.response)
|
174
175
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"meta": {
|
3
|
+
"code": 200
|
4
|
+
},
|
5
|
+
"notifications": [{
|
6
|
+
"type": "notificationTray",
|
7
|
+
"item": {
|
8
|
+
"unreadCount": 0
|
9
|
+
}
|
10
|
+
}],
|
11
|
+
"response": {
|
12
|
+
"managing": [{
|
13
|
+
"id": "14046309",
|
14
|
+
"firstName": "Nashville Geeks",
|
15
|
+
"photo": "https:\/\/is1.4sqi.net\/userpix_thumbs\/IXHCY5SK3SDJC310.png",
|
16
|
+
"type": "page",
|
17
|
+
"followers": {
|
18
|
+
"count": 197,
|
19
|
+
"groups": []
|
20
|
+
},
|
21
|
+
"tips": {
|
22
|
+
"count": 15
|
23
|
+
},
|
24
|
+
"lists": {
|
25
|
+
"groups": [{
|
26
|
+
"type": "created",
|
27
|
+
"count": 1,
|
28
|
+
"items": []
|
29
|
+
}]
|
30
|
+
},
|
31
|
+
"gender": "none",
|
32
|
+
"homeCity": "Nashville, TN",
|
33
|
+
"bio": "",
|
34
|
+
"contact": {
|
35
|
+
"twitter": "nashvillegeeks",
|
36
|
+
"facebook": "119351084835752"
|
37
|
+
}
|
38
|
+
}]
|
39
|
+
}
|
40
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
{
|
2
|
+
"meta": {
|
3
|
+
"code": 200
|
4
|
+
},
|
5
|
+
"notifications": [
|
6
|
+
{
|
7
|
+
"type": "notificationTray",
|
8
|
+
"item": {
|
9
|
+
"unreadCount": 0
|
10
|
+
}
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"response": {
|
14
|
+
"woes": [
|
15
|
+
{
|
16
|
+
"id": "53b956f6498eb33cef9cf879",
|
17
|
+
"type": "info",
|
18
|
+
"comments": [],
|
19
|
+
"reporters": [
|
20
|
+
{
|
21
|
+
"id": "77349316",
|
22
|
+
"firstName": "Amelia Island Coffee",
|
23
|
+
"gender": "none",
|
24
|
+
"relationship": "self",
|
25
|
+
"photo": {
|
26
|
+
"prefix": "https://irs0.4sqi.net/img/user/",
|
27
|
+
"suffix": "/77349316-ZUEQRZ10EF2U1322.png"
|
28
|
+
},
|
29
|
+
"type": "venuePage",
|
30
|
+
"venue": {
|
31
|
+
"id": "4b9d65a8f964a520b0a936e3"
|
32
|
+
},
|
33
|
+
"homeCity": "Fernandina Beach, FL"
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"notes": [
|
37
|
+
{
|
38
|
+
"type": "recent",
|
39
|
+
"text": "This venue has recent check-ins. Please be EXTRA careful."
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"type": "claimed",
|
43
|
+
"text": "This venue is CLAIMED by manager. Please be EXTRA careful."
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"type": "popular",
|
47
|
+
"text": "This venue has more than 250 check-ins. Please be EXTRA careful."
|
48
|
+
}
|
49
|
+
],
|
50
|
+
"correct": true,
|
51
|
+
"resolved": true,
|
52
|
+
"resolvedTime": "Sun Jul 06 14:02:30 UTC 2014",
|
53
|
+
"resolvedUsers": [
|
54
|
+
{
|
55
|
+
"id": "77349316",
|
56
|
+
"firstName": "Amelia Island Coffee",
|
57
|
+
"gender": "none",
|
58
|
+
"relationship": "self",
|
59
|
+
"photo": {
|
60
|
+
"prefix": "https://irs0.4sqi.net/img/user/",
|
61
|
+
"suffix": "/77349316-ZUEQRZ10EF2U1322.png"
|
62
|
+
},
|
63
|
+
"type": "venuePage",
|
64
|
+
"venue": {
|
65
|
+
"id": "4b9d65a8f964a520b0a936e3"
|
66
|
+
}
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"app": {
|
70
|
+
"id": "SDDBI1SDSDEGVP3YUJGAJC0TRNCKCPA5WABTMYQ5OFBVDOLJ",
|
71
|
+
"name": "Foursquare API documentation",
|
72
|
+
"detailUrl": "https://foursquare.com/app/foursquare-api-documentation/SDDBI1SDSDEGVP3YUJGAJC0TRNCKCPA5WABTMYQ5OFBVDOLJ"
|
73
|
+
},
|
74
|
+
"canonicalPath": "/edit/address?id=53b956f6498eb33cef9cf879",
|
75
|
+
"field": "phone",
|
76
|
+
"displayName": "Phone",
|
77
|
+
"value": "(904) 321-2111",
|
78
|
+
"displayValue": "(904) 321-2111",
|
79
|
+
"currentValue": "(904) 321-2111"
|
80
|
+
}
|
81
|
+
]
|
82
|
+
}
|
83
|
+
}
|
data/test/test_pages.rb
CHANGED
@@ -27,5 +27,12 @@ class TestPages < Test::Unit::TestCase
|
|
27
27
|
venues.items.length.should == 2
|
28
28
|
venues.items.first.name.should == "Starbucks"
|
29
29
|
end
|
30
|
+
|
31
|
+
should "fetch pages for manager" do
|
32
|
+
stub_get("https://api.foursquare.com/v2/pages/managing?oauth_token=#{@client.oauth_token}", "pages/managed_pages.json")
|
33
|
+
pages = @client.managed_pages()
|
34
|
+
pages.first.firstName.should == "Nashville Geeks"
|
35
|
+
pages.first.type.should == "page"
|
36
|
+
end
|
30
37
|
end
|
31
38
|
end
|
data/test/test_venues.rb
CHANGED
@@ -75,6 +75,12 @@ class TestVenues < Test::Unit::TestCase
|
|
75
75
|
venues.groups.first.items.count.should == 2
|
76
76
|
end
|
77
77
|
|
78
|
+
should "allow venues to be edited" do
|
79
|
+
stub_post("https://api.foursquare.com/v2/venues/4b9d65a8f964a520b0a936e3/proposeedit?oauth_token=#{@client.oauth_token}", "venues/edit_venue.json")
|
80
|
+
edited_venue = @client.edit_venue("4b9d65a8f964a520b0a936e3", :v => '20140706', :phone => '9043212111')
|
81
|
+
edited_venue.woes.first.currentValue.should == "(904) 321-2111"
|
82
|
+
end
|
83
|
+
|
78
84
|
should "get links for a venue" do
|
79
85
|
stub_get("https://api.foursquare.com/v2/venues/4b8c3d87f964a520f7c532e3/links?oauth_token=#{@client.oauth_token}", "venues/venue_links.json")
|
80
86
|
links = @client.venue_links('4b8c3d87f964a520f7c532e3')
|
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: 2.0.
|
4
|
+
version: 2.0.1
|
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: 2014-
|
13
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -267,6 +267,7 @@ files:
|
|
267
267
|
- test/fixtures/lists/list_item.json
|
268
268
|
- test/fixtures/lists/list_moved_item.json
|
269
269
|
- test/fixtures/lists/list_updated.json
|
270
|
+
- test/fixtures/pages/managed_pages.json
|
270
271
|
- test/fixtures/pages/page.json
|
271
272
|
- test/fixtures/pages/page_venues.json
|
272
273
|
- test/fixtures/pages/search_pages.json
|
@@ -291,6 +292,7 @@ files:
|
|
291
292
|
- test/fixtures/venuegroups/venuegroup.json
|
292
293
|
- test/fixtures/venuegroups/venuegroup_add.json
|
293
294
|
- test/fixtures/venuegroups/venuegroup_update.json
|
295
|
+
- test/fixtures/venues/edit_venue.json
|
294
296
|
- test/fixtures/venues/explore_venues.json
|
295
297
|
- test/fixtures/venues/managed_venues.json
|
296
298
|
- test/fixtures/venues/no_venues_by_tip.json
|
@@ -339,7 +341,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
339
341
|
version: '0'
|
340
342
|
segments:
|
341
343
|
- 0
|
342
|
-
hash:
|
344
|
+
hash: 2866593979360003611
|
343
345
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
344
346
|
none: false
|
345
347
|
requirements:
|