Skip to content

Commit

Permalink
should give them a link to follow too
Browse files Browse the repository at this point in the history
  • Loading branch information
maddox committed Oct 26, 2011
1 parent 419dc47 commit e284049
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/hubot/scripts/maps.coffee
@@ -1,16 +1,24 @@
# Interacts with the Google Maps API.
#
# map me <query> - Returns a map view of the area returned by `query`.

module.exports = (robot) ->

robot.respond /(?:(satellite|terrain|hybrid)[- ])?map me (.+)/i, (msg) ->
mapType = msg.match[1] || "roadmap"
location = msg.match[2]
url = "http://maps.google.com/maps/api/staticmap?markers=" +
mapUrl = "http://maps.google.com/maps/api/staticmap?markers=" +
escape(location) +
"&size=400x400&maptype=" +
mapType +
"&sensor=false" +
"&format=png" # So campfire knows it's an image
url = "http://maps.google.com/maps?q=" +
escape(location) +
"&hl=en&sll=37.0625,-95.677068&sspn=73.579623,100.371094&vpsrc=0&hnear=" +
escape(location) +
"&t=m&z=11"

msg.send mapUrl
msg.send url

0 comments on commit e284049

Please sign in to comment.