Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.rvmrc
Gemfile
Guardfile
LICENSE
README.md
RELEASE_NOTES.md
Rakefile
hungrytable.gemspec

README.md

Hungrytable

The purpose of this gem is to interact with the OpenTable REST API.

Installation

Add this line to your application's Gemfile:

gem 'hungrytable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hungrytable

Usage

You need to set some environment variable for this gem to work properly:

Observe:

# In ~/.bashrc
export OT_PARTNER_ID=<YOUR OPENTABLE PARTNER ID>
export OT_PARTNER_AUTH=<YOUR OPENTABLE PARTNER AUTH> # For XML feed only...
export OT_OAUTH_KEY=<YOUR OPENTABLE OAUTH KEY>
export OT_OAUTH_SECRET=<YOUR OPENTABLE OAUTH SECRET KEY>

Example Run

$ restaurant = Hungrytable::Restaurant.new(82591)  

> #<Hungrytable::Restaurant:0x0000000032e4098 ... >  

$ search = Hungrytable::RestaurantSearch.new(restaurant, {date_time: 5.days.from_now, party_size: 3})  

> #<Hungrytable::RestaurantSearch:0x00000003143388 ... >

$ slotlock = Hungrytable::RestaurantSlotlock.new(search)

> #<Hungrytable::RestaurantSlotlock:0x00000002973a68 ... >

$ reservation = Hungrytable::ReservationMake.new(slotlock, {email_address: 'foo@bar.com', firstname: 'Mike', lastname: 'Jones', phone: '2813308004'})

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
Something went wrong with that request. Please try again.