Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

debug

  • Loading branch information...
commit ff1493355dff58dd3ce636ba1200c30be7b22e13 1 parent 362ac1d
Mike Thomas authored

Showing 1 changed file with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. +9 1 scripts/foursquare.coffee
10 scripts/foursquare.coffee
@@ -8,11 +8,19 @@ module.exports = (robot) ->
8 8
9 9 url = "http://api.yelp.com/business_review_search?term=#{query}&location=#{address}=#{process.env.HUBOT_YWSID}"
10 10
  11 + console.log "URL for yelp: " + url
  12 +
11 13 msg.http(url).get() (err, res, body) ->
12 14 data = JSON.parse(body)
13 15
14   - results = body.businesses
  16 + console.log "response from yelp: " + body
  17 +
  18 + results = data?.businesses
15 19
  20 + if not results?
  21 + msg.send "No results for #{msg.match[1]}"
  22 + return
  23 +
16 24 for r in results
17 25 msg.send "#{r.name}: #{r.url}"
18 26

0 comments on commit ff14933

Please sign in to comment.
Something went wrong with that request. Please try again.