foursquare2 1.9.4 → 1.9.5
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 +3 -2
- data/lib/foursquare2/users.rb +15 -1
- data/test/fixtures/users/user_photos.json +151 -0
- data/test/test_users.rb +7 -0
- metadata +4 -3
data/Readme.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.5
|
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 = "1.9.
|
8
|
+
s.version = "1.9.5"
|
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 = "2013-03-
|
12
|
+
s.date = "2013-03-09"
|
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 = [
|
@@ -72,6 +72,7 @@ Gem::Specification.new do |s|
|
|
72
72
|
"test/fixtures/users/user_checkins_plain.json",
|
73
73
|
"test/fixtures/users/user_lists.json",
|
74
74
|
"test/fixtures/users/user_mayorships.json",
|
75
|
+
"test/fixtures/users/user_photos.json",
|
75
76
|
"test/fixtures/users/user_tips.json",
|
76
77
|
"test/fixtures/users/user_venuestats.json",
|
77
78
|
"test/fixtures/users/user_venuestats_friend_id.json",
|
data/lib/foursquare2/users.rb
CHANGED
@@ -5,7 +5,7 @@ module Foursquare2
|
|
5
5
|
#
|
6
6
|
# @param [Hash] options
|
7
7
|
# @option options Integer :neighbors Number of friends' scores adjacent to your score
|
8
|
-
|
8
|
+
|
9
9
|
def leaderboard(options={})
|
10
10
|
response = connection.get do |req|
|
11
11
|
req.url "users/leaderboard", options
|
@@ -142,6 +142,20 @@ module Foursquare2
|
|
142
142
|
return_error_or_body(response, response.body.response.todos)
|
143
143
|
end
|
144
144
|
|
145
|
+
# Get the photos for the authenticated user.
|
146
|
+
#
|
147
|
+
# @param [Hash] options
|
148
|
+
# @option options Integer :limit - The limit of results to return.
|
149
|
+
# @option options Integer :offset - Used to page through results.
|
150
|
+
|
151
|
+
|
152
|
+
def user_photos(options={})
|
153
|
+
response = connection.get do |req|
|
154
|
+
req.url "users/self/photos", options
|
155
|
+
end
|
156
|
+
return_error_or_body(response, response.body.response.photos)
|
157
|
+
end
|
158
|
+
|
145
159
|
# Get the venue history for the authenticated user.
|
146
160
|
#
|
147
161
|
# @param [Hash] options
|
@@ -0,0 +1,151 @@
|
|
1
|
+
{
|
2
|
+
"meta": {
|
3
|
+
"code": 200
|
4
|
+
},
|
5
|
+
"notifications": [
|
6
|
+
{
|
7
|
+
"type": "notificationTray",
|
8
|
+
"item": {
|
9
|
+
"unreadCount": 1
|
10
|
+
}
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"response": {
|
14
|
+
"photos": {
|
15
|
+
"count": 2,
|
16
|
+
"items": [
|
17
|
+
{
|
18
|
+
"id": "5136e2d3e4b00eba53f0bce0",
|
19
|
+
"createdAt": 1362551507,
|
20
|
+
"source": {
|
21
|
+
"name": "foursquare for iPhone",
|
22
|
+
"url": "https://foursquare.com/download/#/iphone"
|
23
|
+
},
|
24
|
+
"prefix": "https://irs0.4sqi.net/img/general/",
|
25
|
+
"suffix": "/308098_MgBNEkeVohBBWDO3eQVMbUWJFmm-7R5kEEWjhq77xIQ.jpg",
|
26
|
+
"width": 960,
|
27
|
+
"height": 720,
|
28
|
+
"visibility": "public",
|
29
|
+
"venue": {
|
30
|
+
"id": "4b66afdff964a52077272be3",
|
31
|
+
"name": "アカデミーヒルズ",
|
32
|
+
"contact": {
|
33
|
+
|
34
|
+
},
|
35
|
+
"location": {
|
36
|
+
"address": "六本木6-10-1",
|
37
|
+
"crossStreet": "六本木ヒルズ森タワー40F,49F",
|
38
|
+
"lat": 35.660452,
|
39
|
+
"lng": 139.729454,
|
40
|
+
"postalCode": "106-6155",
|
41
|
+
"city": "港区",
|
42
|
+
"state": "東京都",
|
43
|
+
"country": "Japan",
|
44
|
+
"cc": "JP"
|
45
|
+
},
|
46
|
+
"canonicalUrl": "https://foursquare.com/v/%E3%82%A2%E3%82%AB%E3%83%87%E3%83%9F%E3%83%BC%E3%83%92%E3%83%AB%E3%82%BA/4b66afdff964a52077272be3",
|
47
|
+
"categories": [
|
48
|
+
{
|
49
|
+
"id": "4bf58dd8d48988d12d941735",
|
50
|
+
"name": "Monument / Landmark",
|
51
|
+
"pluralName": "Monuments / Landmarks",
|
52
|
+
"shortName": "Landmark",
|
53
|
+
"icon": {
|
54
|
+
"prefix": "https://foursquare.com/img/categories_v2/building/government_monument_",
|
55
|
+
"suffix": ".png"
|
56
|
+
},
|
57
|
+
"primary": true
|
58
|
+
}
|
59
|
+
],
|
60
|
+
"verified": false,
|
61
|
+
"stats": {
|
62
|
+
"checkinsCount": 2256,
|
63
|
+
"usersCount": 927,
|
64
|
+
"tipCount": 5
|
65
|
+
},
|
66
|
+
"url": "http://www.academyhills.com",
|
67
|
+
"likes": {
|
68
|
+
"count": 0,
|
69
|
+
"groups": []
|
70
|
+
},
|
71
|
+
"like": false,
|
72
|
+
"beenHere": {
|
73
|
+
"count": 1,
|
74
|
+
"marked": true
|
75
|
+
}
|
76
|
+
},
|
77
|
+
"checkin": {
|
78
|
+
"id": "5136e2cce4b0dfb1b3003d9d",
|
79
|
+
"createdAt": 1362551500,
|
80
|
+
"type": "checkin",
|
81
|
+
"shout": "ほぼ満席",
|
82
|
+
"timeZoneOffset": 540
|
83
|
+
}
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"id": "5117a5bce4b0f9aeaa0b6098",
|
87
|
+
"createdAt": 1360504252,
|
88
|
+
"source": {
|
89
|
+
"name": "foursquare for iPhone",
|
90
|
+
"url": "https://foursquare.com/download/#/iphone"
|
91
|
+
},
|
92
|
+
"prefix": "https://irs0.4sqi.net/img/general/",
|
93
|
+
"suffix": "/308098_Hx08l9Co4jE2d03s5aniyU0_OiFmuyHTW7RanXIrU7s.jpg",
|
94
|
+
"width": 720,
|
95
|
+
"height": 960,
|
96
|
+
"visibility": "public",
|
97
|
+
"venue": {
|
98
|
+
"id": "4fdc0cfee4b0598b20798fff",
|
99
|
+
"name": "ギークハウス元住吉",
|
100
|
+
"contact": {
|
101
|
+
"twitter": "geekmtsm"
|
102
|
+
},
|
103
|
+
"location": {
|
104
|
+
"lat": 35.56697725449356,
|
105
|
+
"lng": 139.65618716690207,
|
106
|
+
"country": "Japan",
|
107
|
+
"cc": "JP"
|
108
|
+
},
|
109
|
+
"canonicalUrl": "https://foursquare.com/v/%E3%82%AE%E3%83%BC%E3%82%AF%E3%83%8F%E3%82%A6%E3%82%B9%E5%85%83%E4%BD%8F%E5%90%89/4fdc0cfee4b0598b20798fff",
|
110
|
+
"categories": [
|
111
|
+
{
|
112
|
+
"id": "4d954b06a243a5684965b473",
|
113
|
+
"name": "Residential Building (Apartment / Condo)",
|
114
|
+
"pluralName": "Residential Buildings (Apartments / Condos)",
|
115
|
+
"shortName": "Apartment Building",
|
116
|
+
"icon": {
|
117
|
+
"prefix": "https://foursquare.com/img/categories_v2/building/apartment_",
|
118
|
+
"suffix": ".png"
|
119
|
+
},
|
120
|
+
"primary": true
|
121
|
+
}
|
122
|
+
],
|
123
|
+
"verified": false,
|
124
|
+
"stats": {
|
125
|
+
"checkinsCount": 164,
|
126
|
+
"usersCount": 38,
|
127
|
+
"tipCount": 1
|
128
|
+
},
|
129
|
+
"likes": {
|
130
|
+
"count": 0,
|
131
|
+
"groups": []
|
132
|
+
},
|
133
|
+
"like": false,
|
134
|
+
"beenHere": {
|
135
|
+
"count": 63,
|
136
|
+
"marked": true
|
137
|
+
}
|
138
|
+
},
|
139
|
+
"checkin": {
|
140
|
+
"id": "5117a596e4b051a08b3d9d3b",
|
141
|
+
"createdAt": 1360504214,
|
142
|
+
"type": "checkin",
|
143
|
+
"shout": "2011だったら逆にほしかったーっていったらくれた",
|
144
|
+
"isMayor": true,
|
145
|
+
"timeZoneOffset": 540
|
146
|
+
}
|
147
|
+
}
|
148
|
+
]
|
149
|
+
}
|
150
|
+
}
|
151
|
+
}
|
data/test/test_users.rb
CHANGED
@@ -109,6 +109,13 @@ class TestUsers < Test::Unit::TestCase
|
|
109
109
|
friends_venuestats.venues.size.should == 5
|
110
110
|
friends_venuestats.categories.size.should == 8
|
111
111
|
end
|
112
|
+
|
113
|
+
should "fetch photos" do
|
114
|
+
stub_get("https://api.foursquare.com/v2/users/self/photos?oauth_token=#{@client.oauth_token}", "users/user_photos.json")
|
115
|
+
photos = @client.user_photos
|
116
|
+
photos.items.size.should == 2
|
117
|
+
photos.items.first.suffix.should == "/308098_MgBNEkeVohBBWDO3eQVMbUWJFmm-7R5kEEWjhq77xIQ.jpg"
|
118
|
+
end
|
112
119
|
end
|
113
120
|
|
114
121
|
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: 1.9.
|
4
|
+
version: 1.9.5
|
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: 2013-03-
|
13
|
+
date: 2013-03-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
@@ -276,6 +276,7 @@ files:
|
|
276
276
|
- test/fixtures/users/user_checkins_plain.json
|
277
277
|
- test/fixtures/users/user_lists.json
|
278
278
|
- test/fixtures/users/user_mayorships.json
|
279
|
+
- test/fixtures/users/user_photos.json
|
279
280
|
- test/fixtures/users/user_tips.json
|
280
281
|
- test/fixtures/users/user_venuestats.json
|
281
282
|
- test/fixtures/users/user_venuestats_friend_id.json
|
@@ -320,7 +321,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
320
321
|
version: '0'
|
321
322
|
segments:
|
322
323
|
- 0
|
323
|
-
hash:
|
324
|
+
hash: 1921105295492671255
|
324
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
325
326
|
none: false
|
326
327
|
requirements:
|