Project

yelp4rails

0.0
No commit activity in last 3 years
No release in over 3 years
A gem that provides and activerecord like object for interacting with the yelp V2 api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
>= 0.4.7
 Project Readme

yelp4rails

Gem Version Build Status

A gem that provides and ActiveRecord like object for interacting with the yelp V2 api

Why Yelp4Rails?

Because working with an api should be no different that working with a database.

NOTICE!

Version 2 now supports the new Rails 4 style of query using the find_by(params_hash) method. This version is backward compatible with Version 1.x.x but future versions will drop the search_by_term_and_location(:term, :location) meta programming style methods handling.

Consider Yourself Warned!

Usage

require 'yelp4rails'

keys = {consumer_key: 'key', consumer_secret: 'secret', token: 'token', token_secret: 'tsecret'}
yelp = YelpApi.new(keys)

## Search like its an active record model ##
	
#search with term and location
yelp.find_by(term: 'bar', location: 'San Francisco, CA')

#search with term, location, and sort
yelp.find_by(term: 'restaurant', location: 'San Francisco, CA', sort: '2')

#search by business id
yelp.find_by(business_id: 123)

... you get the idea ;)

supported query params

  • key, value, required?
  • term, string, optional
  • limit, number, optional
  • offset, number, optional
  • sort, string, optional
    • Sort mode: 0=Best matched (default), 1=Distance, 2=Highest Rated.
  • category_filter, string, optional
  • radius_filter, number, optional
  • deals_filter, bool, optional