You are looking at historical revision 16726 of this page. It may differ significantly from its current revision.

yelp

Introduction

This egg provides an interface to the public Yelp API. Yelp is a social database of customer reviews of restaurants and businesses. It also provides generalized lookup by phone number, geocode, or address across the United States, Canada, and Great Britain. All six Yelp APIs are supported along with a simple query mechanism for traversing the structured JSON query result. A valid Yelp YWSID is required to use this API. There is no charge for a YWSID, though queries are rate-limited and use is subject to Yelp's API Terms of Use.

API

[tbd]

set-ywsid!
by-phone
hood-for-address
hood-for-geocode
near-address
near-geocode
near-geobox
valid?
display-info
decode
find

Examples

#;1> (use yelp)
; loading /usr/local/chicken/lib/chicken/4/yelp.import.so ...
; loading /usr/local/chicken/lib/chicken/4/srfi-18.import.so ...
; loading /usr/local/chicken/lib/chicken/4/srfi-69.import.so ...
; loading /usr/local/chicken/lib/chicken/4/tcp.import.so ...
; loading /usr/local/chicken/lib/chicken/4/yelp.so ...
#;2> (by-phone "4154376800")
invalid-ywsid
"Invalid YWSID"
#;3> ,l ../ywsid
; loading ../ywsid.scm ...
#;4> (define y (by-phone "4154376800"))
#;5> (valid? y)
#t
#;6> (display-info y)
Pizzeria Delfina
3611 18th Street
San Francisco, CA 94110
(415)437-6800
Neighborhood: Mission
37.761398 -122.424003
#;7> (decode y)
businesses: (1)
  rating_img_url: http://static1.px.yelp.com/static/200911304084228337/i/ico/stars/stars_4.png
  country: USA
  phone: 4154376800
  rating_img_url_small: http://static3.px.yelp.com/static/20091130418129184/i/ico/stars/stars_small_4.png
  state: CA
  longitude: -122.424003601074
  mobile_url: http://mobile.yelp.com/biz/bai6umLcCNy9cXql0Js2RQ
  is_closed: #f
  latitude: 37.7613983154297
  name: Pizzeria Delfina
  ...
message:
  text: OK
  version: 1.1.1
  code: 0
#;8> (find y "businesses.phone")
"4154376800"
#;9> (find y "message.text")
"OK"
#;10> (find y "businesses.neighborhoods.name")
"Mission"

Authors

Derrell Piper

License

BSD

Requirements

None.

The chicken-install tests require the test egg. -test also requires a valid YWSID exist in ../../ywsid above the egg's temporary install directory. When fetched with chicken-install -r, simply creating a file named ywsid in the parent directory with the following content, then do the chicken-install from there:

(set-ywsid! "<your-personal-ywsid-goes-here>")

None of this matters if you don't care about regression tests or do not specify -test to chicken-install.

Version History