Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jonnii-yelp

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jonnii-yelp

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= yelp

A Ruby object-oriented interface to the local business content available on Yelp at http://www.yelp.com. Functionality is provided to perform all searches available via the developer API including:

  • search for business reviews by geo-bounding-box, geo-point, or address/location.
  • search for a business review by business phone number.
  • search for a neighborhood by geo-point or address/location.

More detailed information on the underlying Yelp API, error response codes, and so forth is available at http://www.yelp.com/developers/getting_started.

The RubyForge project is hosted at http://rubyforge.org/projects/yelp. This documentation is available at http://yelp.rubyforge.org.

The latest source code is at http://github.com/shaper/yelp.

== About

Everybody loves Yelp! For those seeking burritos in the Mission District of San Francisco, it's easy to feel awash in a sea of taquerias with little to go on for decision-making other than whether the rice has peas in it (generally a negatory data point) or how long the line happens to be around lunchtime.

Worry no longer! Yelp is here.

Why should you use this library rather than writing directly to their API, or rolling your own? A few reasons that come to mind:

  • 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.
  • we have rudimentary tests, whereas your implementation doesn't (since you haven't even written it yet).
  • we return responses (by default, configurable) as JSON data converted into a Ruby hash and appropriate data types where applicable.
  • (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.

== Requirements

You must have a Yelp Web Service ID (YWSID) available at http://www.yelp.com/developers/getting_started/api_access.

You must conform to the Yelp Branding Requirements when making use of content retrieved via their API, documented at http://www.yelp.com/developers/getting_started/api_branding.

For tests to execute successfully you must have the YWSID set in your environment via (shell-dependent, bash example provided):

% export YWSID='YOUR_ID_HERE'

== Installing

Install +rubygems+ if you don't already have it. See http://rubyforge.org/projects/rubygems/.

Then install the +yelp+ gem by executing:

% gem install yelp

== Usage

Instantiate a Yelp::Client and use its +search+ method to make requests of the Yelp server.

The available search request types are:

  • Yelp::Review::Request::BoundingBox
  • Yelp::Review::Request::GeoPoint
  • Yelp::Review::Request::Location
  • Yelp::Phone::Request::Number
  • Yelp::Neighborhood::Request::GeoPoint
  • Yelp::Neighborhood::Request::Location

By default, response content is formatted as a Ruby hash converted from Yelp's source JSON response content. Alternate response formats (including the original pure JSON) can be specified on request record construction via the Yelp::Request +response_format+ parameter, available in all request record types.

A few examples:

construct a client instance

client = Yelp::Client.new

perform an address/location-based search for cream puffs nearby

request = Yelp::Review::Request::Location.new( :address => '650 Mission St', :city => 'San Francisco', :state => 'CA', :radius => 2, :term => 'cream puffs', :yws_id => 'YOUR_YWSID_HERE') response = client.search(request)

perform a location-based category search for either ice cream or donut shops in SF

request = Yelp::Review::Request::Location.new( :city => 'San Francisco', :state => 'CA', :category => [ 'donuts', 'icecream' ], :yws_id => 'YOUR_YWSID_HERE') response = client.search(request)

perform a neighborhood name lookup for a specific geo-location point

request = Yelp::Neighborhood::Request::GeoPoint.new( :latitude => 37.782093, :longitude => -122.483230, :yws_id => 'YOUR_YWSID_HERE') response = client.search(request)

perform a business review search based on a business phone number

request = Yelp::Phone::Request::Number.new( :phone_number => '4155551212', :yws_id => 'YOUR_YWSID_HERE') response = client.search(request)

If you want to convert some addresses to latitude/longitude, or vice versa, for testing or what have you -- try http://stevemorse.org/jcal/latlon.php.

== License

This library is provided via the GNU LGPL license at http://www.gnu.org/licenses/lgpl.html.

== Authors

Copyright 2007 - 2009, Walter Korman shaper@fatgoose.com, http://lemurware.blogspot.com

FAQs

Package last updated on 10 Sep 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc