Skip to content

Enables your hubot to suggest places to eat lunch. Powered by Yelp

License

Notifications You must be signed in to change notification settings

jvarness/hubot-yelp

Repository files navigation

hubot-yelp

Enables hubot to suggest places for lunchtime.

See src/lunchtime.coffee for full documentation.

Build and Static Analysis

Build Status Codacy Badge

Installation

In hubot project repo, run:

npm install hubot-yelp --save

Then add hubot-yelp to your external-scripts.json:

[
  "hubot-yelp"
]

Configuration

The following configuration is required in order to run the yelp script:

HUBOT_YELP_APP_ID        # The Yelp API application ID
HUBOT_YELP_APP_SECRET    # The Yelp API application secret

These should be configured using the API keys given to you when you sign up for a Yelp Developer API account.

The following configurations are optional:

HUBOT_YELP_DEFAULT_LOCATION   # The default location that should be used
HUBOT_YELP_DEFAULT_CATEGORY   # The default category that should be used
HUBOT_YELP_DEFAULT_LANG       # The default locale that should be used

If a location is not specified, the script is hard-coded to use Kansas City, MO as the default location. If no default category is specified, no category will be used unless specified by the user. If a locale is not specified, the script is hard-coded to use en_US as the default locale.

To see if a locale that you need is supported, check Yelp Fusion's list of supported locales.

Sample Interaction

The hubot-yelp script will allow your hubot to look up different kinds of food for you. By using hubot lunchtime, hubot will find a random place to eat using the default location:

<You> hubot lunchtime
<hubot> Give this place a shot:
<hubot> Novel Restaurant
<hubot> Yelp rating: 4.5
<hubot> Total reviews: 133
<hubot> http://www.yelp.com/biz/novel-restaurant-kansas-city

This script makes it possible to specify any location to find food. Type hubot lunchtime thats to call the script, then specify a category of food:

<You>hubot lunchtime thats bbq
<hubot> Give this place a shot:
<hubot> BRGR Kitchen + Bar
<hubot> Yelp rating: 4
<hubot> Total reviews: 165
<hubot> http://www.yelp.com/biz/brgr-kitchen-bar-kansas-city

The lunchtime script will randomly select a place that matches the category you specified, and print out the name of the place, the rating out of 5 on Yelp, how many reviews the place has been given by Yelp users, and a link to the Yelp website containing reviews, directions, hours of operation, and more.

If you'd rather not specify a category and would rather find a place near a certain location, you can specify that by typing hubot lunchtime near and specifying a location:

<You> hubot lunchtime near Las Vegas, NV
<hubot> Give this place a shot:
<hubot> Fountains of Bellagio
<hubot> Yelp rating: 4.5
<hubot> Total reviews: 940
<hubot> http://www.yelp.com/biz/fountains-of-bellagio-las-vegas

The script also allows you to specify a place and a category by typing hubot lunchtime near <place> thats <category>:

<You> hubot lunchtime near 99206 thats seafood
<hubot> Give this place a shot:
<hubot> Ivar's Seafood Bars
<hubot> Yelp rating: 3
<hubot> Total reviews: 1
<hubot> http://www.yelp.com/biz/ivars-seafood-bars-spokane

Powered by

YelpV3 by danieljin

Yelp

CoffeeScript

Hubot