yelp 1.0.0 → 2.0.0
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.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +22 -504
- data/README.md +152 -0
- data/Rakefile +4 -24
- data/lib/yelp.rb +18 -13
- data/lib/yelp/burst_struct.rb +51 -0
- data/lib/yelp/client.rb +86 -86
- data/lib/yelp/configuration.rb +31 -0
- data/lib/yelp/endpoint/business.rb +42 -0
- data/lib/yelp/endpoint/search.rb +170 -0
- data/lib/yelp/error.rb +55 -0
- data/lib/yelp/version.rb +3 -0
- data/spec/fixtures/vcr_cassettes/business.yml +73 -0
- data/spec/fixtures/vcr_cassettes/search.yml +361 -0
- data/spec/fixtures/vcr_cassettes/search_bounding_box.yml +359 -0
- data/spec/fixtures/vcr_cassettes/search_by_coordinates.yml +387 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/support/request_error.rb +11 -0
- data/spec/support/shared_configuration.rb +11 -0
- data/spec/yelp/burst_struct_spec.rb +124 -0
- data/spec/yelp/client_spec.rb +75 -0
- data/spec/yelp/configuration_spec.rb +44 -0
- data/spec/yelp/endpoint/business_spec.rb +26 -0
- data/spec/yelp/endpoint/search_spec.rb +72 -0
- data/spec/yelp/error_spec.rb +22 -0
- data/spec/yelp/yelp_spec.rb +10 -0
- data/tasks/console.rake +4 -0
- data/yelp.gemspec +32 -0
- metadata +252 -90
- data/CHANGELOG.rdoc +0 -48
- data/Manifest.txt +0 -24
- data/README.rdoc +0 -118
- data/TODO.txt +0 -6
- data/lib/yelp/neighborhood/request/base.rb +0 -13
- data/lib/yelp/neighborhood/request/geo_point.rb +0 -23
- data/lib/yelp/neighborhood/request/location.rb +0 -53
- data/lib/yelp/phone/request/number.rb +0 -24
- data/lib/yelp/record.rb +0 -16
- data/lib/yelp/request.rb +0 -44
- data/lib/yelp/response_format.rb +0 -36
- data/lib/yelp/review/request/base.rb +0 -31
- data/lib/yelp/review/request/bounding_box.rb +0 -37
- data/lib/yelp/review/request/geo_point.rb +0 -28
- data/lib/yelp/review/request/location.rb +0 -63
- data/test/test_client.rb +0 -11
- data/test/test_neighborhood_search.rb +0 -46
- data/test/test_phone_search.rb +0 -20
- data/test/test_review_search.rb +0 -168
- data/test/yelp_helper.rb +0 -45
metadata
CHANGED
@@ -1,110 +1,272 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: yelp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
7
|
-
-
|
6
|
+
authors:
|
7
|
+
- Tomer Elmalem
|
8
|
+
- Yelp
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
date: 2014-04-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.5'
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.5'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '10.0'
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 10.0.0
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '10.0'
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 10.0.0
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rspec
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.6'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.6'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: pry
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.9'
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 0.9.0
|
72
|
+
type: :development
|
73
|
+
prerelease: false
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - "~>"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0.9'
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.9.0
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: vcr
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '2.8'
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 2.8.0
|
92
|
+
type: :development
|
93
|
+
prerelease: false
|
94
|
+
version_requirements: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - "~>"
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '2.8'
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 2.8.0
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: webmock
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - "~>"
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '1.17'
|
21
109
|
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 1.
|
24
|
-
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: hoe
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: 1.17.0
|
27
112
|
type: :development
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
113
|
+
prerelease: false
|
114
|
+
version_requirements: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '1.17'
|
31
119
|
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: 1.17.0
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
name: yard
|
124
|
+
requirement: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - "~>"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0.8'
|
129
|
+
type: :development
|
130
|
+
prerelease: false
|
131
|
+
version_requirements: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - "~>"
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0.8'
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
name: faraday
|
138
|
+
requirement: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - "~>"
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0.8'
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.8.0
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0.8'
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: 0.8.0
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
name: faraday_middleware
|
158
|
+
requirement: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - "~>"
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0.8'
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: 0.8.0
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
requirements:
|
170
|
+
- - "~>"
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: '0.8'
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: 0.8.0
|
176
|
+
- !ruby/object:Gem::Dependency
|
177
|
+
name: simple_oauth
|
178
|
+
requirement: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - "~>"
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0.2'
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
version: 0.2.0
|
186
|
+
type: :runtime
|
187
|
+
prerelease: false
|
188
|
+
version_requirements: !ruby/object:Gem::Requirement
|
189
|
+
requirements:
|
190
|
+
- - "~>"
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
version: '0.2'
|
193
|
+
- - ">="
|
194
|
+
- !ruby/object:Gem::Version
|
195
|
+
version: 0.2.0
|
196
|
+
description: Provides easy way to interact with the Yelp API in any kind of application
|
197
|
+
email:
|
198
|
+
- telmalem@gmail.com
|
199
|
+
- partnerships@yelp.com
|
42
200
|
executables: []
|
43
|
-
|
44
201
|
extensions: []
|
45
|
-
|
46
|
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
- TODO.txt
|
50
|
-
- CHANGELOG.rdoc
|
51
|
-
- README.rdoc
|
52
|
-
files:
|
53
|
-
- CHANGELOG.rdoc
|
202
|
+
extra_rdoc_files: []
|
203
|
+
files:
|
204
|
+
- ".gitignore"
|
205
|
+
- Gemfile
|
54
206
|
- LICENSE.txt
|
55
|
-
-
|
56
|
-
- README.rdoc
|
207
|
+
- README.md
|
57
208
|
- Rakefile
|
58
|
-
- TODO.txt
|
59
209
|
- lib/yelp.rb
|
210
|
+
- lib/yelp/burst_struct.rb
|
60
211
|
- lib/yelp/client.rb
|
61
|
-
- lib/yelp/
|
62
|
-
- lib/yelp/
|
63
|
-
- lib/yelp/
|
64
|
-
- lib/yelp/
|
65
|
-
- lib/yelp/
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
212
|
+
- lib/yelp/configuration.rb
|
213
|
+
- lib/yelp/endpoint/business.rb
|
214
|
+
- lib/yelp/endpoint/search.rb
|
215
|
+
- lib/yelp/error.rb
|
216
|
+
- lib/yelp/version.rb
|
217
|
+
- spec/fixtures/vcr_cassettes/business.yml
|
218
|
+
- spec/fixtures/vcr_cassettes/search.yml
|
219
|
+
- spec/fixtures/vcr_cassettes/search_bounding_box.yml
|
220
|
+
- spec/fixtures/vcr_cassettes/search_by_coordinates.yml
|
221
|
+
- spec/spec_helper.rb
|
222
|
+
- spec/support/request_error.rb
|
223
|
+
- spec/support/shared_configuration.rb
|
224
|
+
- spec/yelp/burst_struct_spec.rb
|
225
|
+
- spec/yelp/client_spec.rb
|
226
|
+
- spec/yelp/configuration_spec.rb
|
227
|
+
- spec/yelp/endpoint/business_spec.rb
|
228
|
+
- spec/yelp/endpoint/search_spec.rb
|
229
|
+
- spec/yelp/error_spec.rb
|
230
|
+
- spec/yelp/yelp_spec.rb
|
231
|
+
- tasks/console.rake
|
232
|
+
- yelp.gemspec
|
233
|
+
homepage: https://github.com/yelp/yelp.rb
|
234
|
+
licenses:
|
235
|
+
- MIT
|
236
|
+
metadata: {}
|
81
237
|
post_install_message:
|
82
|
-
rdoc_options:
|
83
|
-
|
84
|
-
- README.rdoc
|
85
|
-
require_paths:
|
238
|
+
rdoc_options: []
|
239
|
+
require_paths:
|
86
240
|
- lib
|
87
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
requirements:
|
241
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
242
|
+
requirements:
|
89
243
|
- - ">="
|
90
|
-
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
-
|
93
|
-
|
94
|
-
requirements:
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
version: '0'
|
246
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
95
248
|
- - ">="
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
-
version:
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0'
|
99
251
|
requirements: []
|
100
|
-
|
101
|
-
|
102
|
-
rubygems_version: 1.3.5
|
252
|
+
rubyforge_project:
|
253
|
+
rubygems_version: 2.2.2
|
103
254
|
signing_key:
|
104
|
-
specification_version:
|
105
|
-
summary:
|
106
|
-
test_files:
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
255
|
+
specification_version: 4
|
256
|
+
summary: Ruby client library for the Yelp API
|
257
|
+
test_files:
|
258
|
+
- spec/fixtures/vcr_cassettes/business.yml
|
259
|
+
- spec/fixtures/vcr_cassettes/search.yml
|
260
|
+
- spec/fixtures/vcr_cassettes/search_bounding_box.yml
|
261
|
+
- spec/fixtures/vcr_cassettes/search_by_coordinates.yml
|
262
|
+
- spec/spec_helper.rb
|
263
|
+
- spec/support/request_error.rb
|
264
|
+
- spec/support/shared_configuration.rb
|
265
|
+
- spec/yelp/burst_struct_spec.rb
|
266
|
+
- spec/yelp/client_spec.rb
|
267
|
+
- spec/yelp/configuration_spec.rb
|
268
|
+
- spec/yelp/endpoint/business_spec.rb
|
269
|
+
- spec/yelp/endpoint/search_spec.rb
|
270
|
+
- spec/yelp/error_spec.rb
|
271
|
+
- spec/yelp/yelp_spec.rb
|
272
|
+
has_rdoc:
|
data/CHANGELOG.rdoc
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
== YELP_20091019_1_0_0
|
2
|
-
|
3
|
-
* [shaper] allow specifying multiple categories for review search by
|
4
|
-
passing an array of the category names in the request.
|
5
|
-
|
6
|
-
* [shaper] fix tests to gracefully alert user if YWSID is not set in
|
7
|
-
their environment.
|
8
|
-
|
9
|
-
* [shaper] updated README to reflect the latest reality.
|
10
|
-
|
11
|
-
* [shaper] updated Rakefile to reflect latest hoe usage.
|
12
|
-
|
13
|
-
* [shaper] fixed test neighborhood search to reflect add'l info passed
|
14
|
-
along in yelp response.
|
15
|
-
|
16
|
-
* [shaper] fixed test json validation to reflect new version of 1.1.1.
|
17
|
-
|
18
|
-
* [shaper] fixed neighborhood test to suit new www.yelp.com return
|
19
|
-
url.
|
20
|
-
|
21
|
-
== 0.2.1 / 2007-11-24
|
22
|
-
|
23
|
-
* [shaper] fixed extra dependencies specified in Rakefile to allow for proper
|
24
|
-
gem installation.
|
25
|
-
|
26
|
-
== 0.2.0 / 2007-11-24
|
27
|
-
|
28
|
-
* [shaper] fixed validation of neighborhood yelp search url to reflect
|
29
|
-
yelp-side url fix removing '/' from immediately following '?'.
|
30
|
-
|
31
|
-
* [shaper] fixed json result validation to accept new format v1.1 specifier.
|
32
|
-
|
33
|
-
* [shaper] Incorporated category result narrowing for business review search,
|
34
|
-
thanks to Jerry Cheung for patch.
|
35
|
-
|
36
|
-
* Updated neighborhood tests to reflect additional information in the yelp
|
37
|
-
response.
|
38
|
-
|
39
|
-
== 0.1.1 / 2007-08-06
|
40
|
-
|
41
|
-
* Moved to Rubyforge now that the yelp project exists.
|
42
|
-
|
43
|
-
* Fixed Yelp::Request documentation to note the correct default response
|
44
|
-
format as Yelp::ResponseFormat::JSON_TO_RUBY.
|
45
|
-
|
46
|
-
== 0.1.0 / 2007-08-05
|
47
|
-
|
48
|
-
* Initial release.
|
data/Manifest.txt
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
CHANGELOG.rdoc
|
2
|
-
LICENSE.txt
|
3
|
-
Manifest.txt
|
4
|
-
README.rdoc
|
5
|
-
Rakefile
|
6
|
-
TODO.txt
|
7
|
-
lib/yelp.rb
|
8
|
-
lib/yelp/client.rb
|
9
|
-
lib/yelp/record.rb
|
10
|
-
lib/yelp/response_format.rb
|
11
|
-
lib/yelp/request.rb
|
12
|
-
lib/yelp/neighborhood/request/base.rb
|
13
|
-
lib/yelp/neighborhood/request/geo_point.rb
|
14
|
-
lib/yelp/neighborhood/request/location.rb
|
15
|
-
lib/yelp/phone/request/number.rb
|
16
|
-
lib/yelp/review/request/base.rb
|
17
|
-
lib/yelp/review/request/bounding_box.rb
|
18
|
-
lib/yelp/review/request/geo_point.rb
|
19
|
-
lib/yelp/review/request/location.rb
|
20
|
-
test/test_client.rb
|
21
|
-
test/test_neighborhood_search.rb
|
22
|
-
test/test_phone_search.rb
|
23
|
-
test/test_review_search.rb
|
24
|
-
test/yelp_helper.rb
|
data/README.rdoc
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
= yelp
|
2
|
-
|
3
|
-
A Ruby object-oriented interface to the local business content available
|
4
|
-
on Yelp at http://www.yelp.com. Functionality is provided to perform
|
5
|
-
all searches available via the developer API including:
|
6
|
-
|
7
|
-
* search for business reviews by geo-bounding-box, geo-point, or address/location.
|
8
|
-
* search for a business review by business phone number.
|
9
|
-
* search for a neighborhood by geo-point or address/location.
|
10
|
-
|
11
|
-
More detailed information on the underlying Yelp API, error response codes, and so forth is available at http://www.yelp.com/developers/getting_started.
|
12
|
-
|
13
|
-
The RubyForge project is hosted at http://rubyforge.org/projects/yelp. This documentation is available at http://yelp.rubyforge.org.
|
14
|
-
|
15
|
-
The latest source code is at http://github.com/shaper/yelp.
|
16
|
-
|
17
|
-
== About
|
18
|
-
|
19
|
-
Everybody loves Yelp! For those seeking burritos in the Mission District of
|
20
|
-
San Francisco, it's easy to feel awash in a sea of taquerias with little to go
|
21
|
-
on for decision-making other than whether the rice has peas in it (generally a
|
22
|
-
negatory data point) or how long the line happens to be around lunchtime.
|
23
|
-
|
24
|
-
Worry no longer! Yelp is here.
|
25
|
-
|
26
|
-
Why should you use this library rather than writing directly to their API, or rolling your own? A few reasons that come to mind:
|
27
|
-
|
28
|
-
* we've done a variety of mini-legwork from which you, Yelp and our fellow netizens will benefit, such as making sure we inform the Yelp server that we support gzipped data over the wire to save on bandwidth.
|
29
|
-
* we have rudimentary tests, whereas your implementation doesn't (since you haven't even written it yet).
|
30
|
-
* we return responses (by default, configurable) as JSON data converted into a Ruby hash and appropriate data types where applicable.
|
31
|
-
* (subjective but we know we're right) -- we think our API is a nicer layer for Ruby developers to work with than the bare-bones REST API that Yelp provides.
|
32
|
-
|
33
|
-
== Requirements
|
34
|
-
|
35
|
-
You must have a Yelp Web Service ID (YWSID) available at http://www.yelp.com/developers/getting_started/api_access.
|
36
|
-
|
37
|
-
You must conform to the Yelp Branding Requirements when making use of content
|
38
|
-
retrieved via their API, documented at http://www.yelp.com/developers/getting_started/api_branding.
|
39
|
-
|
40
|
-
For tests to execute successfully you must have the YWSID set in your
|
41
|
-
environment via (shell-dependent, bash example provided):
|
42
|
-
|
43
|
-
% export YWSID='YOUR_ID_HERE'
|
44
|
-
|
45
|
-
== Installing
|
46
|
-
|
47
|
-
Install +rubygems+ if you don't already have it. See http://rubyforge.org/projects/rubygems/.
|
48
|
-
|
49
|
-
Then install the +yelp+ gem by executing:
|
50
|
-
|
51
|
-
% gem install yelp
|
52
|
-
|
53
|
-
== Usage
|
54
|
-
|
55
|
-
Instantiate a Yelp::Client and use its +search+ method to make requests of
|
56
|
-
the Yelp server.
|
57
|
-
|
58
|
-
The available search request types are:
|
59
|
-
|
60
|
-
* Yelp::Review::Request::BoundingBox
|
61
|
-
* Yelp::Review::Request::GeoPoint
|
62
|
-
* Yelp::Review::Request::Location
|
63
|
-
* Yelp::Phone::Request::Number
|
64
|
-
* Yelp::Neighborhood::Request::GeoPoint
|
65
|
-
* Yelp::Neighborhood::Request::Location
|
66
|
-
|
67
|
-
By default, response content is formatted as a Ruby hash converted from Yelp's
|
68
|
-
source JSON response content. Alternate response formats (including the
|
69
|
-
original pure JSON) can be specified on request record construction via the
|
70
|
-
Yelp::Request +response_format+ parameter, available in all request record
|
71
|
-
types.
|
72
|
-
|
73
|
-
A few examples:
|
74
|
-
|
75
|
-
# construct a client instance
|
76
|
-
client = Yelp::Client.new
|
77
|
-
|
78
|
-
# perform an address/location-based search for cream puffs nearby
|
79
|
-
request = Yelp::Review::Request::Location.new(
|
80
|
-
:address => '650 Mission St',
|
81
|
-
:city => 'San Francisco',
|
82
|
-
:state => 'CA',
|
83
|
-
:radius => 2,
|
84
|
-
:term => 'cream puffs',
|
85
|
-
:yws_id => 'YOUR_YWSID_HERE')
|
86
|
-
response = client.search(request)
|
87
|
-
|
88
|
-
# perform a location-based category search for either ice cream or donut shops in SF
|
89
|
-
request = Yelp::Review::Request::Location.new(
|
90
|
-
:city => 'San Francisco',
|
91
|
-
:state => 'CA',
|
92
|
-
:category => [ 'donuts', 'icecream' ],
|
93
|
-
:yws_id => 'YOUR_YWSID_HERE')
|
94
|
-
response = client.search(request)
|
95
|
-
|
96
|
-
# perform a neighborhood name lookup for a specific geo-location point
|
97
|
-
request = Yelp::Neighborhood::Request::GeoPoint.new(
|
98
|
-
:latitude => 37.782093,
|
99
|
-
:longitude => -122.483230,
|
100
|
-
:yws_id => 'YOUR_YWSID_HERE')
|
101
|
-
response = client.search(request)
|
102
|
-
|
103
|
-
# perform a business review search based on a business phone number
|
104
|
-
request = Yelp::Phone::Request::Number.new(
|
105
|
-
:phone_number => '4155551212',
|
106
|
-
:yws_id => 'YOUR_YWSID_HERE')
|
107
|
-
response = client.search(request)
|
108
|
-
|
109
|
-
If you want to convert some addresses to latitude/longitude, or vice
|
110
|
-
versa, for testing or what have you -- try http://stevemorse.org/jcal/latlon.php.
|
111
|
-
|
112
|
-
== License
|
113
|
-
|
114
|
-
This library is provided via the GNU LGPL license at http://www.gnu.org/licenses/lgpl.html.
|
115
|
-
|
116
|
-
== Authors
|
117
|
-
|
118
|
-
Copyright 2007 - 2009, Walter Korman <shaper@fatgoose.com>, http://lemurware.blogspot.com
|