Project

yp

0.0
No commit activity in last 3 years
No release in over 3 years
Simple ruby wrapper for YP.com API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

< 0.8, >= 0.6
>= 3.0
 Project Readme

Yp

Simple Ruby wrapper to yp.com api.

Installation

Add this line to your application's Gemfile:

gem 'yp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install yp

Usage

Acquire an api key by registering at http://developer.yp.com

client = Yp::Client.new(api_key: YOUR_API_KEY)

To do a search:

results = c.search(searchloc: ZIP_CODE, term: SEARCH_TERM, listingcount: 50, sort: 'distance')

This returns an array of hashes. See http://developer.yp.com/api/Listings%2520Endpoints/Search for the attribute keys.

To do a details listing lookup, you will need this listing id, presumably found using the search api above.

detail = c.details(LISTING_ID_STRING)
businessName = detail['businessName']

This returns a hash with attribute/value pairs. See http://http://developer.yp.com/api/Listings%2520Endpoints/Details

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request