Changeset 20246 in project


Ignore:
Timestamp:
09/11/10 22:31:57 (10 years ago)
Author:
anonymous
Message:

move license to end and just ref bsd; lose a level; add egg tag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/yelp

    r19031 r20246  
     1[[tags: egg]]
    12== yelp
    23
    34[[toc:]]
    45
    5 === Introduction
     6== Introduction
    67
    78This egg provides an interface to the [[http://www.yelp.com/about|Yelp]] [[http://www.yelp.com/developers/getting_started|API]].  Yelp is a social database of 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 JSON query result.  A valid Yelp [[http://www.yelp.com/developers/getting_started|YWSID]] is required to use this API.  There is no charge for a YWSID, though each YWSID has a daily query limit (1000) and use is subject to Yelp's [[http://www.yelp.com/developers/getting_started/api_terms|API Terms of Use]].
     
    910[[image:http://static1.px.yelp.com/static/200911301285253944/i/developers/Powered_By_Yelp_Red.png|Yelp logo]]
    1011
    11 === Examples
     12== Examples
    1213
    1314 #;1> (use yelp)
     
    4445 "Mission"
    4546
    46 === Authors
     47== Authors
    4748
    4849Derrell Piper
    4950
    50 === License
    51 
    52  Copyright (c) 2009 Derrell Piper.
    53  All rights reserved.
    54 
    55  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
    56  conditions are met:
    57 
    58    Redistributions of source code must retain the above copyright notice, this list of conditions and the following
    59      disclaimer.
    60    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
    61      disclaimer in the documentation and/or other materials provided with the distribution.
    62    Neither the name of the author nor the names of its contributors may be used to endorse or promote
    63    products derived from this software without specific prior written permission.
    64 
    65  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
    66  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    67  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
    68  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    69  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    70  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    71  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    72  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    73  POSSIBILITY OF SUCH DAMAGE.
    74 
    75 === Requirements
     51== Requirements
    7652
    7753Requires the [[json]] egg.
     
    8561None of this matters if you don't care about regression tests or if you do not specify {{-test}} to {{chicken-install}}.
    8662
    87 === API
    88 
    89 ==== Authorization and Introspection
     63== API
     64
     65=== Authorization and Introspection
    9066
    9167<procedure>(set-ywsid! YWSID)</procedure>
     
    10682{{valid?}} checks for both {{"OK"}} and {{0}}.
    10783
    108 ==== Error Handling
     84=== Error Handling
    10985
    11086The Yelp API consists of the following functions:
     
    126102Other values represent the translation of {{"message.code"}} in the Yelp response.  {{'yelp-success}} implies {{valid?}}.
    127103
    128 ==== Yelp Phone API
     104=== Yelp Phone API
    129105
    130106See [[http://www.yelp.com/developers/documentation/phone_api|Yelp Phone API]].
     
    142118This egg currently understands only the North American Numbering Plan syntax (US and Canada).  Sorry mates.
    143119
    144 ==== Yelp Neighborhood API
     120=== Yelp Neighborhood API
    145121
    146122See [[http://www.yelp.com/developers/documentation/neighborhood_api|Yelp Neighborhood API]].
     
    154130Returns the neighborhood name associated with a geocode location, {{LAT}} and {{LON}}.
    155131
    156 ==== Yelp Review Search API
     132=== Yelp Review Search API
    157133
    158134See [[http://www.yelp.com/developers/documentation/search_api|Yelp Review Search API]]
     
    190166Returns a list of {{NUMBER}} reviews for businesses containing {{TERM}} and located in a box with the top-left geocode of {{TL-LAT}} and {{TL-LON}} and a bottom-right geocode of {{BR-LAT}} and {{BR-LON}}.  The {{CATEGORY}} keyword may be used to limit the search to a particular Yelp [[http://www.yelp.com/developers/documentation/category_list|category]] name, e.g., {{"divebars+lounges"}}.
    191167
    192 ==== Display and Query
     168=== Display and Query
    193169
    194170<procedure>(display-info RESPONSE [PORT])</procedure>
     
    213189Walks the JSON tree and searches for the JSON key specified by {{PATH}}.  They syntax of {{find}} uses simple dotted notation to describe the pathname, for example: {{businesses.phone}} or {{message.code}}.
    214190
    215 ==== Implementation Notes
     191=== Implementation Notes
    216192
    217193The Yelp routines alway return an outermost JSON structure which the JSON egg maps to a vector.  {{find}} returns a list, vector, or a simple value (number, string, #t, #f, or null), depending on what's being queried.  {{decode}} and {{find}} accept lists and vectors.  For example:
     
    243219Note that {{find}} stops on first match, so regular iteration must be used to access second and subsequent elements, as in the first example above (i.e., categories by {{"name"}}).
    244220
    245 ==== Limitations
     221=== Limitations
    246222
    247223The Yelp servers sometime return spurious {{HTML 301}} redirects (on a good day) for no apparent reason.  There's a sizeable amount of information returned by default for the "{{near-}}" queries, so it makes sense to limit queries using {{#:number}} or {{#:category}} when possible.
    248224
    249 === Version History
     225== Version History
    250226
    251227* 1.0 Initial release
     228
     229== License
     230
     231Copyright (C) 2009 Derrell Piper.  BSD-licensed.
Note: See TracChangeset for help on using the changeset viewer.