Grubber

Grubber helps you find a place to eat neaby.

Installation

Simply:

$ gem install grubber

API Access

Grubber uses the Yelp API to find nearby places. To use grubber you must get yourself Yelp API access. You can do so at: http://www.yelp.com/developers

Once you have your tokens, run grubber auth. This will prompt you for your credentials and get you the rest of the way.

Location Services

Grubber uses CoreLocation to find out where you're geographically operating. It will request permission once and then cache your location. Grubber will automatically find your coordinates when needed if you haven't previously located yourself.

Granting Permission

CoreLocation requires you grant ruby permission to use Location Services. You should be prompted for permission once, and don't have to worry about it again.

Revoking Permission

To revoke previously granted permissions, you can uncheck ruby in:

System Preferences > Security & Privacy > Privacy > Location Services

Updating your location

You can request grubber to update its cached location by calling locate:

$ grubber locate
Updated coordinates to: 37.782487810714265, -122.40982359190473

Developers Note: No stalkers please

Usage

Grubber has two primary commands:

List

Grubber can list a bunch of nearby restaurants. Each entry has the name, rating, address, category, phone and url.

Protip: If using iTerm, you can cmd+click on a url to open in your default browser

$ grubber list

Split Pea Seduction  ★ ★ ★ ★ ☆
138 6th St
[Sandwiches] +1-415-551-2223
http://www.yelp.com/biz/split-pea-seduction-san-francisco

Miss SaiGon  ★ ★ ★ ★ ☆
100 6th St
[Vietnamese] +1-415-522-0332
http://www.yelp.com/biz/miss-saigon-san-francisco-2

Punjab Kabab House  ★ ★ ★ ☆ ☆
101 Eddy St
[Indian] +1-415-447-7499
http://www.yelp.com/biz/punjab-kabab-house-san-francisco

Cafe Venue  ★ ★ ★ ☆ ☆
67 5th St
[Coffee & Tea] +1-415-546-1144
http://www.yelp.com/biz/cafe-venue-san-francisco-7

...

Pick

Grubber can just go ahead and pick a nearby restaurant for you to avoid you having to think about exactly where you want to go. Pick returns all the same fields as list.

$ grubber pick

Tu Lan  ★ ★ ★ ★ ☆
8 6th St
[Vietnamese] +1-415-626-0927
http://www.yelp.com/biz/tu-lan-san-francisco-2

The CLI

grubber help [TASK]  # Describe available tasks or one specific task
grubber auth         # Enter your Yelp API credentials
grubber list         # List available nearby restaurants
grubber locate       # Refresh your grubber's known coordinates
grubber pick         # Pick a restaurant nearby

Troubleshooting

When I run call locate twice in a row, it just hangs. wtf

If you request a new location from CoreLocation too quickly, the command will simply hang. Unfortunately this pertains to [a problem]((https://github.com/evanphx/lost/pull/2) with the awesome ruby wrapper lost that evanphx has written. Grubber will cache your location, so it shouldn't be a problem. Just don't move around so fast.

The future

I would like to add a few features to grubber. Such as:

  • Testing
  • Preferred tags/categories of food
  • CLI for search terms
  • Price range
  • Maximum distance

Contributing

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