portero 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.simplecov +3 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +67 -0
- data/Rakefile +2 -0
- data/lib/portero/portero.rb +33 -0
- data/lib/portero/providers/foursquare.rb +39 -0
- data/lib/portero/providers/google_places.rb +41 -0
- data/lib/portero/search_provider.rb +52 -0
- data/lib/portero/search_result.rb +5 -0
- data/lib/portero/version.rb +3 -0
- data/lib/portero.rb +2 -0
- data/portero.gemspec +25 -0
- data/spec/data/foursquare.json +437 -0
- data/spec/data/google_places.json +343 -0
- data/spec/portero_spec.rb +24 -0
- data/spec/providers/foursquare_spec.rb +72 -0
- data/spec/providers/google_places_spec.rb +77 -0
- data/spec/search_provider_spec.rb +46 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/support/fakeweb.rb +6 -0
- metadata +173 -0
@@ -0,0 +1,437 @@
|
|
1
|
+
{ "meta" : { "code" : 200 },
|
2
|
+
"response" : { "venues" : [ { "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/nightlife/bar_",
|
3
|
+
"suffix" : ".png"
|
4
|
+
},
|
5
|
+
"id" : "4bf58dd8d48988d116941735",
|
6
|
+
"name" : "Bar",
|
7
|
+
"pluralName" : "Bars",
|
8
|
+
"primary" : true,
|
9
|
+
"shortName" : "Bar"
|
10
|
+
} ],
|
11
|
+
"contact" : { "formattedPhone" : "(314) 238-2300",
|
12
|
+
"phone" : "3142382300",
|
13
|
+
"twitter" : "BarLouie"
|
14
|
+
},
|
15
|
+
"hereNow" : { "count" : 0,
|
16
|
+
"groups" : [ ]
|
17
|
+
},
|
18
|
+
"id" : "4ade3739f964a520fa7321e3",
|
19
|
+
"likes" : { "count" : 0,
|
20
|
+
"groups" : [ ]
|
21
|
+
},
|
22
|
+
"location" : { "address" : "110 S Kirkwood Rd",
|
23
|
+
"cc" : "US",
|
24
|
+
"city" : "St. Louis",
|
25
|
+
"country" : "United States",
|
26
|
+
"crossStreet" : "in Kirkwood Station",
|
27
|
+
"distance" : 628,
|
28
|
+
"lat" : 38.58033319446212,
|
29
|
+
"lng" : -90.40589386753355,
|
30
|
+
"postalCode" : "63122",
|
31
|
+
"state" : "MO"
|
32
|
+
},
|
33
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4ade3739f964a520fa7321e3/device_menu",
|
34
|
+
"type" : "foodAndBeverage",
|
35
|
+
"url" : "https://foursquare.com/v/bar-louie/4ade3739f964a520fa7321e3/menu"
|
36
|
+
},
|
37
|
+
"name" : "Bar Louie",
|
38
|
+
"referralId" : "v-1345738732",
|
39
|
+
"specials" : { "count" : 0,
|
40
|
+
"items" : [ ]
|
41
|
+
},
|
42
|
+
"stats" : { "checkinsCount" : 3717,
|
43
|
+
"tipCount" : 17,
|
44
|
+
"usersCount" : 1906
|
45
|
+
},
|
46
|
+
"url" : "http://www.barlouieamerica.com",
|
47
|
+
"verified" : true
|
48
|
+
},
|
49
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
50
|
+
"suffix" : ".png"
|
51
|
+
},
|
52
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
53
|
+
"name" : "Pizza Place",
|
54
|
+
"pluralName" : "Pizza Places",
|
55
|
+
"primary" : true,
|
56
|
+
"shortName" : "Pizza"
|
57
|
+
} ],
|
58
|
+
"contact" : { "formattedPhone" : "(314) 821-7474",
|
59
|
+
"phone" : "3148217474",
|
60
|
+
"twitter" : "DeweysPizza"
|
61
|
+
},
|
62
|
+
"hereNow" : { "count" : 0,
|
63
|
+
"groups" : [ ]
|
64
|
+
},
|
65
|
+
"id" : "4afded07f964a5201f2c22e3",
|
66
|
+
"likes" : { "count" : 0,
|
67
|
+
"groups" : [ ]
|
68
|
+
},
|
69
|
+
"location" : { "address" : "124 N Kirkwood Rd",
|
70
|
+
"cc" : "US",
|
71
|
+
"city" : "Kirkwood",
|
72
|
+
"country" : "United States",
|
73
|
+
"crossStreet" : "at Jefferson",
|
74
|
+
"distance" : 449,
|
75
|
+
"lat" : 38.58210175811794,
|
76
|
+
"lng" : -90.40618835575445,
|
77
|
+
"postalCode" : "63122",
|
78
|
+
"state" : "MO"
|
79
|
+
},
|
80
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4afded07f964a5201f2c22e3/device_menu",
|
81
|
+
"type" : "foodAndBeverage",
|
82
|
+
"url" : "https://foursquare.com/v/deweys-pizza/4afded07f964a5201f2c22e3/menu"
|
83
|
+
},
|
84
|
+
"name" : "Dewey's Pizza",
|
85
|
+
"referralId" : "v-1345738732",
|
86
|
+
"specials" : { "count" : 0,
|
87
|
+
"items" : [ ]
|
88
|
+
},
|
89
|
+
"stats" : { "checkinsCount" : 2486,
|
90
|
+
"tipCount" : 32,
|
91
|
+
"usersCount" : 1308
|
92
|
+
},
|
93
|
+
"url" : "http://www.deweyspizza.com",
|
94
|
+
"verified" : true
|
95
|
+
},
|
96
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/default_",
|
97
|
+
"suffix" : ".png"
|
98
|
+
},
|
99
|
+
"id" : "4bf58dd8d48988d14e941735",
|
100
|
+
"name" : "American Restaurant",
|
101
|
+
"pluralName" : "American Restaurants",
|
102
|
+
"primary" : true,
|
103
|
+
"shortName" : "American"
|
104
|
+
} ],
|
105
|
+
"contact" : { },
|
106
|
+
"hereNow" : { "count" : 0,
|
107
|
+
"groups" : [ ]
|
108
|
+
},
|
109
|
+
"id" : "4acbc3fdf964a520dac620e3",
|
110
|
+
"likes" : { "count" : 0,
|
111
|
+
"groups" : [ ]
|
112
|
+
},
|
113
|
+
"location" : { "address" : "471 North Kirkwood Road",
|
114
|
+
"cc" : "US",
|
115
|
+
"city" : "St. Louis",
|
116
|
+
"country" : "United States",
|
117
|
+
"distance" : 282,
|
118
|
+
"lat" : 38.58662593544057,
|
119
|
+
"lng" : -90.406602483540297,
|
120
|
+
"postalCode" : "63122",
|
121
|
+
"state" : "MO"
|
122
|
+
},
|
123
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4acbc3fdf964a520dac620e3/device_menu",
|
124
|
+
"type" : "foodAndBeverage",
|
125
|
+
"url" : "https://foursquare.com/v/fortels-original-pizza-den/4acbc3fdf964a520dac620e3/menu"
|
126
|
+
},
|
127
|
+
"name" : "Fortel's Original Pizza Den",
|
128
|
+
"referralId" : "v-1345738732",
|
129
|
+
"specials" : { "count" : 0,
|
130
|
+
"items" : [ ]
|
131
|
+
},
|
132
|
+
"stats" : { "checkinsCount" : 234,
|
133
|
+
"tipCount" : 1,
|
134
|
+
"usersCount" : 160
|
135
|
+
},
|
136
|
+
"verified" : false
|
137
|
+
},
|
138
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
139
|
+
"suffix" : ".png"
|
140
|
+
},
|
141
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
142
|
+
"name" : "Pizza Place",
|
143
|
+
"pluralName" : "Pizza Places",
|
144
|
+
"primary" : true,
|
145
|
+
"shortName" : "Pizza"
|
146
|
+
} ],
|
147
|
+
"contact" : { "formattedPhone" : "(314) 822-3488",
|
148
|
+
"phone" : "3148223488"
|
149
|
+
},
|
150
|
+
"hereNow" : { "count" : 0,
|
151
|
+
"groups" : [ ]
|
152
|
+
},
|
153
|
+
"id" : "4c705042fa49a1cd3fc8a5e3",
|
154
|
+
"likes" : { "count" : 0,
|
155
|
+
"groups" : [ ]
|
156
|
+
},
|
157
|
+
"location" : { "address" : "471 N Kirkwood Rd",
|
158
|
+
"cc" : "US",
|
159
|
+
"city" : "Saint Louis",
|
160
|
+
"country" : "United States",
|
161
|
+
"distance" : 248,
|
162
|
+
"lat" : 38.58611563973181,
|
163
|
+
"lng" : -90.40670871734619,
|
164
|
+
"postalCode" : "63122",
|
165
|
+
"state" : "MO"
|
166
|
+
},
|
167
|
+
"name" : "Fortel's Pizza Den",
|
168
|
+
"referralId" : "v-1345738732",
|
169
|
+
"specials" : { "count" : 0,
|
170
|
+
"items" : [ ]
|
171
|
+
},
|
172
|
+
"stats" : { "checkinsCount" : 52,
|
173
|
+
"tipCount" : 0,
|
174
|
+
"usersCount" : 18
|
175
|
+
},
|
176
|
+
"verified" : false
|
177
|
+
},
|
178
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/fastfood_",
|
179
|
+
"suffix" : ".png"
|
180
|
+
},
|
181
|
+
"id" : "4bf58dd8d48988d16e941735",
|
182
|
+
"name" : "Fast Food Restaurant",
|
183
|
+
"pluralName" : "Fast Food Restaurants",
|
184
|
+
"primary" : true,
|
185
|
+
"shortName" : "Fast Food"
|
186
|
+
} ],
|
187
|
+
"contact" : { "formattedPhone" : "(314) 909-9803",
|
188
|
+
"phone" : "3149099803",
|
189
|
+
"twitter" : "tacobell"
|
190
|
+
},
|
191
|
+
"hereNow" : { "count" : 0,
|
192
|
+
"groups" : [ ]
|
193
|
+
},
|
194
|
+
"id" : "4bb761e846d4a5938d60c7c0",
|
195
|
+
"likes" : { "count" : 0,
|
196
|
+
"groups" : [ ]
|
197
|
+
},
|
198
|
+
"location" : { "address" : "353 South Kirkwood Road",
|
199
|
+
"cc" : "US",
|
200
|
+
"city" : "Kirkwood",
|
201
|
+
"country" : "United States",
|
202
|
+
"distance" : 981,
|
203
|
+
"lat" : 38.57668732337479,
|
204
|
+
"lng" : -90.40685096230176,
|
205
|
+
"postalCode" : "63122",
|
206
|
+
"state" : "Missouri"
|
207
|
+
},
|
208
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4bb761e846d4a5938d60c7c0/device_menu",
|
209
|
+
"type" : "foodAndBeverage",
|
210
|
+
"url" : "https://foursquare.com/v/taco-bell/4bb761e846d4a5938d60c7c0/menu"
|
211
|
+
},
|
212
|
+
"name" : "Taco Bell",
|
213
|
+
"referralId" : "v-1345738732",
|
214
|
+
"specials" : { "count" : 0,
|
215
|
+
"items" : [ ]
|
216
|
+
},
|
217
|
+
"stats" : { "checkinsCount" : 537,
|
218
|
+
"tipCount" : 3,
|
219
|
+
"usersCount" : 258
|
220
|
+
},
|
221
|
+
"url" : "http://www.tacobell.com",
|
222
|
+
"verified" : true
|
223
|
+
},
|
224
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
225
|
+
"suffix" : ".png"
|
226
|
+
},
|
227
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
228
|
+
"name" : "Pizza Place",
|
229
|
+
"pluralName" : "Pizza Places",
|
230
|
+
"primary" : true,
|
231
|
+
"shortName" : "Pizza"
|
232
|
+
} ],
|
233
|
+
"contact" : { },
|
234
|
+
"hereNow" : { "count" : 0,
|
235
|
+
"groups" : [ ]
|
236
|
+
},
|
237
|
+
"id" : "4ea89e6493adf5b1fbcecafa",
|
238
|
+
"likes" : { "count" : 0,
|
239
|
+
"groups" : [ ]
|
240
|
+
},
|
241
|
+
"location" : { "address" : "140 S Kirkwood Rd",
|
242
|
+
"cc" : "US",
|
243
|
+
"city" : "Kirkwood",
|
244
|
+
"country" : "United States",
|
245
|
+
"distance" : 670,
|
246
|
+
"lat" : 38.579918675644855,
|
247
|
+
"lng" : -90.40586165801797,
|
248
|
+
"postalCode" : "63122",
|
249
|
+
"state" : "MO"
|
250
|
+
},
|
251
|
+
"name" : "Pazzo's Pizzeria",
|
252
|
+
"referralId" : "v-1345738732",
|
253
|
+
"specials" : { "count" : 0,
|
254
|
+
"items" : [ ]
|
255
|
+
},
|
256
|
+
"stats" : { "checkinsCount" : 142,
|
257
|
+
"tipCount" : 3,
|
258
|
+
"usersCount" : 111
|
259
|
+
},
|
260
|
+
"verified" : false
|
261
|
+
},
|
262
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
263
|
+
"suffix" : ".png"
|
264
|
+
},
|
265
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
266
|
+
"name" : "Pizza Place",
|
267
|
+
"pluralName" : "Pizza Places",
|
268
|
+
"primary" : true,
|
269
|
+
"shortName" : "Pizza"
|
270
|
+
} ],
|
271
|
+
"contact" : { "formattedPhone" : "(314) 909-0008",
|
272
|
+
"phone" : "3149090008"
|
273
|
+
},
|
274
|
+
"hereNow" : { "count" : 0,
|
275
|
+
"groups" : [ ]
|
276
|
+
},
|
277
|
+
"id" : "4b36a870f964a5201b3a25e3",
|
278
|
+
"likes" : { "count" : 0,
|
279
|
+
"groups" : [ ]
|
280
|
+
},
|
281
|
+
"location" : { "address" : "111 N Kirkwood Rd.",
|
282
|
+
"cc" : "US",
|
283
|
+
"city" : "St Louis",
|
284
|
+
"country" : "United States",
|
285
|
+
"distance" : 470,
|
286
|
+
"lat" : 38.581743000000003,
|
287
|
+
"lng" : -90.406422000000006,
|
288
|
+
"postalCode" : "63122",
|
289
|
+
"state" : "MO"
|
290
|
+
},
|
291
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4b36a870f964a5201b3a25e3/device_menu",
|
292
|
+
"type" : "foodAndBeverage",
|
293
|
+
"url" : "https://foursquare.com/v/racanellis-pizza/4b36a870f964a5201b3a25e3/menu"
|
294
|
+
},
|
295
|
+
"name" : "Racanelli's Pizza",
|
296
|
+
"referralId" : "v-1345738732",
|
297
|
+
"specials" : { "count" : 0,
|
298
|
+
"items" : [ ]
|
299
|
+
},
|
300
|
+
"stats" : { "checkinsCount" : 433,
|
301
|
+
"tipCount" : 6,
|
302
|
+
"usersCount" : 247
|
303
|
+
},
|
304
|
+
"verified" : false
|
305
|
+
},
|
306
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
307
|
+
"suffix" : ".png"
|
308
|
+
},
|
309
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
310
|
+
"name" : "Pizza Place",
|
311
|
+
"pluralName" : "Pizza Places",
|
312
|
+
"primary" : true,
|
313
|
+
"shortName" : "Pizza"
|
314
|
+
} ],
|
315
|
+
"contact" : { "formattedPhone" : "+31 496 636 669",
|
316
|
+
"phone" : "+31496636669"
|
317
|
+
},
|
318
|
+
"hereNow" : { "count" : 0,
|
319
|
+
"groups" : [ ]
|
320
|
+
},
|
321
|
+
"id" : "4b47bf6af964a520013d26e3",
|
322
|
+
"likes" : { "count" : 0,
|
323
|
+
"groups" : [ ]
|
324
|
+
},
|
325
|
+
"location" : { "address" : "215 S Kirkwood Rd",
|
326
|
+
"cc" : "US",
|
327
|
+
"city" : "Kirkwood",
|
328
|
+
"country" : "United States",
|
329
|
+
"crossStreet" : "at Monroe Ave",
|
330
|
+
"distance" : 718,
|
331
|
+
"lat" : 38.57926368713379,
|
332
|
+
"lng" : -90.406379000000001,
|
333
|
+
"postalCode" : "63122",
|
334
|
+
"state" : "MO"
|
335
|
+
},
|
336
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4b47bf6af964a520013d26e3/device_menu",
|
337
|
+
"type" : "foodAndBeverage",
|
338
|
+
"url" : "https://foursquare.com/v/imos-pizza/4b47bf6af964a520013d26e3/menu"
|
339
|
+
},
|
340
|
+
"name" : "Imo's Pizza",
|
341
|
+
"referralId" : "v-1345738732",
|
342
|
+
"specials" : { "count" : 0,
|
343
|
+
"items" : [ ]
|
344
|
+
},
|
345
|
+
"stats" : { "checkinsCount" : 341,
|
346
|
+
"tipCount" : 4,
|
347
|
+
"usersCount" : 200
|
348
|
+
},
|
349
|
+
"verified" : false
|
350
|
+
},
|
351
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
352
|
+
"suffix" : ".png"
|
353
|
+
},
|
354
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
355
|
+
"name" : "Pizza Place",
|
356
|
+
"pluralName" : "Pizza Places",
|
357
|
+
"primary" : true,
|
358
|
+
"shortName" : "Pizza"
|
359
|
+
} ],
|
360
|
+
"contact" : { "formattedPhone" : "(314) 821-7474",
|
361
|
+
"phone" : "3148217474"
|
362
|
+
},
|
363
|
+
"hereNow" : { "count" : 0,
|
364
|
+
"groups" : [ ]
|
365
|
+
},
|
366
|
+
"id" : "4f3296c919836c91c7e68500",
|
367
|
+
"likes" : { "count" : 0,
|
368
|
+
"groups" : [ ]
|
369
|
+
},
|
370
|
+
"location" : { "address" : "124 N Kirkwood Rd",
|
371
|
+
"cc" : "US",
|
372
|
+
"city" : "Saint Louis",
|
373
|
+
"country" : "United States",
|
374
|
+
"distance" : 494,
|
375
|
+
"lat" : 38.581510000000002,
|
376
|
+
"lng" : -90.406369999999995,
|
377
|
+
"state" : "MO"
|
378
|
+
},
|
379
|
+
"name" : "Dewey Deweys Pizza Pizzeria Pizzaria",
|
380
|
+
"referralId" : "v-1345738732",
|
381
|
+
"specials" : { "count" : 0,
|
382
|
+
"items" : [ ]
|
383
|
+
},
|
384
|
+
"stats" : { "checkinsCount" : 15,
|
385
|
+
"tipCount" : 0,
|
386
|
+
"usersCount" : 15
|
387
|
+
},
|
388
|
+
"url" : "http://www.deweyspizza.com/",
|
389
|
+
"verified" : false
|
390
|
+
},
|
391
|
+
{ "categories" : [ { "icon" : { "prefix" : "https://foursquare.com/img/categories_v2/food/pizza_",
|
392
|
+
"suffix" : ".png"
|
393
|
+
},
|
394
|
+
"id" : "4bf58dd8d48988d1ca941735",
|
395
|
+
"name" : "Pizza Place",
|
396
|
+
"pluralName" : "Pizza Places",
|
397
|
+
"primary" : true,
|
398
|
+
"shortName" : "Pizza"
|
399
|
+
} ],
|
400
|
+
"contact" : { "formattedPhone" : "(314) 821-4111",
|
401
|
+
"phone" : "3148214111"
|
402
|
+
},
|
403
|
+
"hereNow" : { "count" : 0,
|
404
|
+
"groups" : [ ]
|
405
|
+
},
|
406
|
+
"id" : "4b75f0f6f964a520bd302ee3",
|
407
|
+
"likes" : { "count" : 0,
|
408
|
+
"groups" : [ ]
|
409
|
+
},
|
410
|
+
"location" : { "address" : "485 S. Kirkwood Rd",
|
411
|
+
"cc" : "US",
|
412
|
+
"city" : "Kirkwood",
|
413
|
+
"country" : "United States",
|
414
|
+
"distance" : 1187,
|
415
|
+
"lat" : 38.57481048677205,
|
416
|
+
"lng" : -90.40681415053449,
|
417
|
+
"postalCode" : "63122",
|
418
|
+
"state" : "MO"
|
419
|
+
},
|
420
|
+
"menu" : { "mobileUrl" : "https://foursquare.com/v/4b75f0f6f964a520bd302ee3/device_menu",
|
421
|
+
"type" : "foodAndBeverage",
|
422
|
+
"url" : "https://foursquare.com/v/dominos-pizza/4b75f0f6f964a520bd302ee3/menu"
|
423
|
+
},
|
424
|
+
"name" : "Domino's Pizza",
|
425
|
+
"referralId" : "v-1345738732",
|
426
|
+
"specials" : { "count" : 0,
|
427
|
+
"items" : [ ]
|
428
|
+
},
|
429
|
+
"stats" : { "checkinsCount" : 40,
|
430
|
+
"tipCount" : 0,
|
431
|
+
"usersCount" : 20
|
432
|
+
},
|
433
|
+
"url" : "http://www.dominos.com/",
|
434
|
+
"verified" : true
|
435
|
+
}
|
436
|
+
] }
|
437
|
+
}
|