You are looking at historical revision 16688 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 social database of customer reviews of restaurants and businesses. It also provides for generalized lookup by phone number, geocode, or address. All six Yelp APIs are supported along with a simply query mechanism for traversing the structured JSON query result. A valid (free) Yelp YWSID is required to use this API.

Examples

#;1> (require-library yelp)
; loading /usr/local/chicken/lib/chicken/4/yelp.so ... 
#;2> (import (prefix yelp 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 ...
#;3> ,l ../ywsid
; loading ../ywsid.scm ...
#;3> (define y (yelp/by-phone "4154376800"))
#;4> (yelp/info? y)
#t
#;5> (yelp/info y)
Pizzeria Delfina
3611 18th Street
San Francisco, CA 94110
(415)437-6800(415)437-6800#<unspecified>
Neighborhood: Mission
37.761398 -122.424003
#;6> (yelp/decode y)
businesses: (1)
  rating_img_url: http://static1.px.yelp.com/static/200911304084228337/i/ico/stars/stars_4.png
  country: USA
  phone: 4154376800
  ...
message:
  text: OK
  version: 1.1.1
  code: 0
#;7> (yelp/find y "businesses.phone")
"4154376800"
#;8> (yelp/find y "message.text")
"OK"
#;9> (yelp/find y "businesses.neighborhoods.name")
"Mission"

Authors

Derrell Piper

License

BSD

Requirements

None.

The chicken-install test case requires the test egg. The -test also requires that a valid YWSID exist in ../../ywsid above the egg's temporary install directory. When fetched with chicken-install -r, simply create a file named ywsid in the current directory with the following content:

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

Version History