Project

zomato2

0.0
No commit activity in last 3 years
No release in over 3 years
Client library for Zomato API 2.1
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 2.1
~> 10.0
~> 3.5
~> 3.0
~> 2.3

Runtime

~> 0.11.0
 Project Readme

Zomato2

This is a simple and clean wrapper for the API version 2.1 of Zomato / Urbanspoon.

Installation

Add this gem to your application's Gemfile:

gem 'zomato2'

And then execute:

$ bundle

Or install directly with:

$ gem install zomato2

Usage

require 'zomato2'

zom_api_key = ENV['ZOMATO_API_KEY']
zomato = Zomato2::Zomato.new(zom_api_key)

puts zomato.restaurants #.each { |r| puts r.details.reviews }

zomato.cities({q: 'new'}).each do |c|
  c.restaurants.each { |r| puts r.details }
end

nyc = zomato.cities(q: "New York City, NY")[0]

american_nyc = nyc.cuisines.find {|c| c.name == 'American'}

top_trending_nyc = nyc.collections[0]

fine_dining_nyc = nyc.establishments.find {|e| e.name == 'Fine Dining' }

american_rests_in_nyc = american_nyc.restaurants

american_rests_in_nyc.find_all {|r| r.name =~ /Joe/ } .each { |r| puts r.menu }

some_rests1 = zomato.restaurants establishment_type: fine_dining_nyc.id, start:10, count: 5

some_rests2 = zomato.restaurants q: 'Lisboa'

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install.

Contributing

Bug reports and pull requests are welcome.

License

The gem is available as open source under the terms of the MIT License.