gowalla 0.1.2 → 0.1.3
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 +2 -2
- data/VERSION +1 -1
- data/changelog.md +5 -0
- data/gowalla.gemspec +4 -2
- data/lib/gowalla/client.rb +13 -5
- data/test/fixtures/events.json +134 -360
- data/test/fixtures/find_trips.json +694 -710
- data/test/fixtures/item.json +6 -67
- data/test/fixtures/items.json +59 -131
- data/test/fixtures/missing_items.json +1 -0
- data/test/fixtures/spot.json +197 -131
- data/test/fixtures/stamps.json +220 -160
- data/test/fixtures/top_spots.json +63 -62
- data/test/fixtures/trip.json +20 -20
- data/test/fixtures/trips.json +881 -957
- data/test/fixtures/user.json +37 -35
- data/test/fixtures/vaulted_items.json +12 -0
- data/test/test_gowalla.rb +34 -24
- metadata +4 -2
data/test/fixtures/user.json
CHANGED
@@ -1,41 +1,43 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"items_count": 10,
|
4
|
-
"stamps_count": 486,
|
5
|
-
"friends_url": "/users/1/friends",
|
6
|
-
"first_name": "Scott",
|
7
|
-
"vaulted_kinds_count": 53,
|
8
|
-
"friends_count": 416,
|
9
|
-
"fb_id": 505421674,
|
10
|
-
"request_url": "/friendships/request?user_id=1",
|
2
|
+
"bookmarked_spots_url": "/spots?bookmarks_user_id=1",
|
11
3
|
"activity_url": "/users/1/events",
|
12
|
-
"
|
13
|
-
"hometown": "Austin, Texas",
|
14
|
-
"stamps_url": "/users/1/stamps",
|
15
|
-
"twitter_username": null,
|
16
|
-
"events_url": "/users/1/events",
|
17
|
-
"pins_url": "/users/1/pins",
|
18
|
-
"accept_url": "/friendships/accept?user_id=1",
|
19
|
-
"last_visit": {
|
20
|
-
"spot": {
|
21
|
-
"name": "Tropisueño",
|
22
|
-
"image_url": "http://static.gowalla.com/categories/15-standard.png",
|
23
|
-
"url": "/spots/19199",
|
24
|
-
"small_image_url": "http://static.gowalla.com/categories/15-small-standard.png"
|
25
|
-
},
|
26
|
-
"comment": "This is a test...",
|
27
|
-
"created_at": "2010/02/10 01:41:16 +0000"
|
28
|
-
},
|
29
|
-
"url": "/users/1",
|
4
|
+
"bio": "CTO & co-founder of Gowalla. Ruby/Cocoa/JavaScript developer. Game designer. Author. Indoorsman.",
|
30
5
|
"image_url": "http://s3.amazonaws.com/static.gowalla.com/users/1-standard.jpg?1263521844",
|
31
|
-
"
|
6
|
+
"pins_url": "/users/1/pins",
|
7
|
+
"trips_count": 3,
|
8
|
+
"bookmarked_spots_count": 2,
|
9
|
+
"friends_count": 444,
|
10
|
+
"trips_url": "/users/1/trips",
|
32
11
|
"items_url": "/users/1/items",
|
33
|
-
"
|
12
|
+
"_bookmarked_spots_urls_url": "/users/1/bookmarked_spots_urls",
|
13
|
+
"twitter_username": "",
|
14
|
+
"last_checkins": [
|
15
|
+
{
|
16
|
+
"type": "checkin",
|
17
|
+
"created_at": "2010-03-06T21:15:22+00:00",
|
18
|
+
"message": "Trying the new BBQ trailer. ",
|
19
|
+
"url": "/checkins/4342021",
|
20
|
+
"spot": {
|
21
|
+
"image_url": "http://static.gowalla.com/categories/17-standard.png",
|
22
|
+
"name": "Muck-N-Dave's Texas BBQ",
|
23
|
+
"url": "/spots/646423"
|
24
|
+
}
|
25
|
+
}
|
26
|
+
],
|
27
|
+
"pins_count": 21,
|
28
|
+
"stamps_count": 506,
|
29
|
+
"facebook_id": 505421674,
|
30
|
+
"photos_url": "/users/1/photos",
|
31
|
+
"top_spots_url": "/users/1/top_spots",
|
32
|
+
"add_friend_url": "/friendships/request?user_id=1",
|
34
33
|
"last_name": "Raymond",
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
34
|
+
"url": "/users/1",
|
35
|
+
"photos_count": 24,
|
36
|
+
"friends_url": "/users/1/friends",
|
37
|
+
"website": "",
|
38
|
+
"hometown": "Austin, Texas",
|
39
|
+
"first_name": "Scott",
|
40
|
+
"stamps_url": "/users/1/stamps",
|
41
|
+
"items_count": 8,
|
42
|
+
"_is_friend": false
|
41
43
|
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"items": [{
|
3
|
+
"image_url": "http://static.gowalla.com/kinds/1661-799838260b4873e99d07fd9c1fe64757.png",
|
4
|
+
"drop_url": "/items/1501734/drop",
|
5
|
+
"name": "Football Helmet",
|
6
|
+
"activity_url": "/items/1501734/events",
|
7
|
+
"determiner": "a",
|
8
|
+
"issue_number": 9932,
|
9
|
+
"url": "/items/1501734",
|
10
|
+
"pick_up_url": "/items/1501734/pick_up"
|
11
|
+
}]
|
12
|
+
}
|
data/test/test_gowalla.rb
CHANGED
@@ -26,21 +26,21 @@ class TestGowalla < Test::Unit::TestCase
|
|
26
26
|
spot = @client.spot(18568)
|
27
27
|
spot.name.should == "Wahoo's"
|
28
28
|
spot.twitter_username.should == 'Wahoos512'
|
29
|
-
spot.
|
29
|
+
spot.spot_categories.first.name.should == 'Mexican'
|
30
30
|
end
|
31
31
|
|
32
32
|
should "retrieve a list of check-ins at a particular spot. Shows only the activity that is visible to a given user" do
|
33
33
|
stub_get('http://pengwynn:0U812@api.gowalla.com/spots/452593/events', 'events.json')
|
34
34
|
events = @client.spot_events(452593)
|
35
|
-
events.first[:type].should == '
|
36
|
-
events.first.user.
|
35
|
+
events.first[:type].should == 'checkin'
|
36
|
+
events.first.user.last_name.should == 'Mack'
|
37
37
|
end
|
38
38
|
|
39
39
|
should "retrieve a list of items available at a particular spot" do
|
40
40
|
stub_get('http://pengwynn:0U812@api.gowalla.com/spots/18568/items', 'items.json')
|
41
41
|
items = @client.spot_items(18568)
|
42
|
-
items.first.issue_number.should ==
|
43
|
-
items.first.name.should == '
|
42
|
+
items.first.issue_number.should == 27868
|
43
|
+
items.first.name.should == 'Bowl of Noodles'
|
44
44
|
end
|
45
45
|
|
46
46
|
should "lists all spot categories" do
|
@@ -66,23 +66,23 @@ class TestGowalla < Test::Unit::TestCase
|
|
66
66
|
stub_get('http://pengwynn:0U812@api.gowalla.com/users/sco', 'user.json')
|
67
67
|
user = @client.user('sco')
|
68
68
|
user.bio.should == "CTO & co-founder of Gowalla. Ruby/Cocoa/JavaScript developer. Game designer. Author. Indoorsman."
|
69
|
-
user.stamps_count.should ==
|
69
|
+
user.stamps_count.should == 506
|
70
70
|
end
|
71
71
|
|
72
72
|
should "retrieve a list of the stamps the user has collected" do
|
73
73
|
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/stamps?limit=20', 'stamps.json')
|
74
74
|
stamps = @client.stamps(1707)
|
75
75
|
stamps.size.should == 20
|
76
|
-
stamps.first.name.should == '
|
77
|
-
stamps.first.
|
76
|
+
stamps.first.spot.name.should == "Muck-N-Dave's Texas BBQ"
|
77
|
+
stamps.first.spot.address.locality.should == 'Austin'
|
78
78
|
end
|
79
79
|
|
80
80
|
should "retrieve a list of spots the user has visited most often" do
|
81
81
|
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/top_spots', 'top_spots.json')
|
82
82
|
top_spots = @client.top_spots(1707)
|
83
83
|
top_spots.size.should == 10
|
84
|
-
top_spots.first.name.should == '
|
85
|
-
top_spots.first.
|
84
|
+
top_spots.first.name.should == 'Juan Pelota Cafe'
|
85
|
+
top_spots.first.user_checkins_count.should == 30
|
86
86
|
end
|
87
87
|
|
88
88
|
end
|
@@ -93,7 +93,7 @@ class TestGowalla < Test::Unit::TestCase
|
|
93
93
|
item = @client.item(607583)
|
94
94
|
item.issue_number.should == 13998
|
95
95
|
item.name.should == 'Sweets'
|
96
|
-
item.
|
96
|
+
item.determiner.should == 'some'
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -101,15 +101,15 @@ class TestGowalla < Test::Unit::TestCase
|
|
101
101
|
should "retrieve a list of trips" do
|
102
102
|
stub_get('http://pengwynn:0U812@api.gowalla.com/trips', 'trips.json')
|
103
103
|
trips = @client.trips
|
104
|
-
trips.first.
|
104
|
+
trips.first.name.should == 'London Pub Crawl'
|
105
105
|
trips.first.spots.first.url.should == '/spots/164009'
|
106
106
|
end
|
107
107
|
|
108
108
|
should "retrieve information about a specific trip" do
|
109
109
|
stub_get('http://pengwynn:0U812@api.gowalla.com/trips/1', 'trip.json')
|
110
110
|
trip = @client.trip(1)
|
111
|
-
trip.creator.
|
112
|
-
trip.map_bounds.east.should == -63.
|
111
|
+
trip.creator.last_name.should == 'Gowalla'
|
112
|
+
trip.map_bounds.east.should == -63.457031
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
@@ -142,15 +142,15 @@ class TestGowalla < Test::Unit::TestCase
|
|
142
142
|
should "retrieve events for a user" do
|
143
143
|
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/events', 'events.json')
|
144
144
|
events = @client.events(1707)
|
145
|
-
events.first[:type].should == '
|
146
|
-
events.first.user.
|
145
|
+
events.first[:type].should == 'checkin'
|
146
|
+
events.first.user.last_name.should == 'Mack'
|
147
147
|
end
|
148
148
|
|
149
149
|
should "retrieve events for a user's friends" do
|
150
150
|
stub_get('http://pengwynn:0U812@api.gowalla.com/visits/recent', 'events.json')
|
151
151
|
events = @client.friends_events
|
152
|
-
events.first[:type].should == '
|
153
|
-
events.first.user.
|
152
|
+
events.first[:type].should == 'checkin'
|
153
|
+
events.first.user.last_name.should == 'Mack'
|
154
154
|
end
|
155
155
|
|
156
156
|
should "retrieve friend requests for a user" do
|
@@ -168,8 +168,21 @@ class TestGowalla < Test::Unit::TestCase
|
|
168
168
|
should "retrieve items for a user" do
|
169
169
|
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/items', 'items.json')
|
170
170
|
items = @client.items(1707)
|
171
|
-
items.first.issue_number.should ==
|
172
|
-
items.first.name.should == '
|
171
|
+
items.first.issue_number.should == 27868
|
172
|
+
items.first.name.should == 'Bowl of Noodles'
|
173
|
+
end
|
174
|
+
|
175
|
+
should "retrieve missing items for a user" do
|
176
|
+
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/items/missing', 'missing_items.json')
|
177
|
+
items = @client.missing_items(1707)
|
178
|
+
items.first.name.should == 'Torch'
|
179
|
+
end
|
180
|
+
|
181
|
+
should "retrieve vaulted items for a user" do
|
182
|
+
stub_get('http://pengwynn:0U812@api.gowalla.com/users/1707/items/vault', 'vaulted_items.json')
|
183
|
+
items = @client.vaulted_items(1707)
|
184
|
+
items.first.issue_number.should == 9932
|
185
|
+
items.first.name.should == 'Football Helmet'
|
173
186
|
end
|
174
187
|
|
175
188
|
should "retrieve pins for a user" do
|
@@ -199,7 +212,7 @@ class TestGowalla < Test::Unit::TestCase
|
|
199
212
|
spot = @client.spot(452593)
|
200
213
|
spot.name.should == "Wahoo's"
|
201
214
|
spot.twitter_username.should == 'Wahoos512'
|
202
|
-
spot.
|
215
|
+
spot.spot_categories.first.name.should == 'Mexican'
|
203
216
|
end
|
204
217
|
|
205
218
|
|
@@ -240,7 +253,6 @@ class TestGowalla < Test::Unit::TestCase
|
|
240
253
|
trips = @client.trips(:lat => 33.234042160, :lng => -96.955138020, :user_id => 1707)
|
241
254
|
trips.first.name.should == 'Dallas Championship Chase'
|
242
255
|
trips.first.spots.size.should == 3
|
243
|
-
trips.first.published?.should == true
|
244
256
|
end
|
245
257
|
|
246
258
|
should "find featured trips by latitude, longitude, and user" do
|
@@ -248,7 +260,6 @@ class TestGowalla < Test::Unit::TestCase
|
|
248
260
|
trips = @client.featured_trips(:lat => 33.234042160, :lng => -96.955138020, :user_id => 1707, :context => 'featured')
|
249
261
|
trips.first.name.should == 'Dallas Championship Chase'
|
250
262
|
trips.first.spots.size.should == 3
|
251
|
-
trips.first.published?.should == true
|
252
263
|
end
|
253
264
|
|
254
265
|
should "find friends trips by latitude, longitude, and user" do
|
@@ -256,7 +267,6 @@ class TestGowalla < Test::Unit::TestCase
|
|
256
267
|
trips = @client.friends_trips(:lat => 33.234042160, :lng => -96.955138020, :user_id => 1707, :context => 'featured')
|
257
268
|
trips.first.name.should == 'Dallas Championship Chase'
|
258
269
|
trips.first.spots.size.should == 3
|
259
|
-
trips.first.published?.should == true
|
260
270
|
end
|
261
271
|
|
262
272
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gowalla
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wynn Netherland
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-03-
|
12
|
+
date: 2010-03-07 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- test/fixtures/item.json
|
105
105
|
- test/fixtures/items.json
|
106
106
|
- test/fixtures/me.json
|
107
|
+
- test/fixtures/missing_items.json
|
107
108
|
- test/fixtures/new_spot.json
|
108
109
|
- test/fixtures/pins.json
|
109
110
|
- test/fixtures/potential_twitter_friends.json
|
@@ -115,6 +116,7 @@ files:
|
|
115
116
|
- test/fixtures/trip.json
|
116
117
|
- test/fixtures/trips.json
|
117
118
|
- test/fixtures/user.json
|
119
|
+
- test/fixtures/vaulted_items.json
|
118
120
|
- test/fixtures/visited_spots.json
|
119
121
|
- test/helper.rb
|
120
122
|
- test/test_gowalla.rb
|