Code Monkey home page Code Monkey logo

hubot-yelp's Introduction

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_CONSUMER_KEY       # The Yelp API consumer key
HUBOT_YELP_CONSUMER_SECRET    # The Yelp API consumer secret
HUBOT_YELP_TOKEN              # The Yelp API consumer token
HUBOT_YELP_TOKEN_SECRET       # The Yelp API token secret

All of these should be configured using the API keys given to you when you signed 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 language 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 language is not specified, the script is hard-coded to use en as the default language.

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

Yelp

CoffeeScript

Hubot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.