Skip to content
Browse files

debug

  • Loading branch information...
1 parent 362ac1d commit ff1493355dff58dd3ce636ba1200c30be7b22e13 @mthomas committed Mar 8, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 scripts/foursquare.coffee
View
10 scripts/foursquare.coffee
@@ -8,11 +8,19 @@ module.exports = (robot) ->
url = "http://api.yelp.com/business_review_search?term=#{query}&location=#{address}=#{process.env.HUBOT_YWSID}"
+ console.log "URL for yelp: " + url
+
msg.http(url).get() (err, res, body) ->
data = JSON.parse(body)
- results = body.businesses
+ console.log "response from yelp: " + body
+
+ results = data?.businesses
+ if not results?
+ msg.send "No results for #{msg.match[1]}"
+ return
+
for r in results
msg.send "#{r.name}: #{r.url}"

0 comments on commit ff14933

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