Permalink
Browse files

Merge pull request #210 from Airborn/patch-1

Makes 'me' optional in shorten script
  • Loading branch information...
2 parents 5775cbe + c032cfe commit ccbf4cb37d47acf2ac3a087c5de8bd62600ddef3 @tombell tombell committed Dec 10, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/scripts/shorten.coffee
@@ -3,13 +3,13 @@
# (bitly|shorten) me <url> - Shorten the URL using bit.ly
module.exports = (robot) ->
- robot.respond /(bitly|shorten) me (.+)$/, (msg) ->
+ robot.respond /(bitly|shorten) (me)? (.+)$/, (msg) ->
msg
.http("http://api.bitly.com/v3/shorten")
.query
login: process.env.HUBOT_BITLY_USERNAME
apiKey: process.env.HUBOT_BITLY_API_KEY
- longUrl: msg.match[2]
+ longUrl: msg.match[3]
format: "json"
.get() (err, res, body) ->
response = JSON.parse body

0 comments on commit ccbf4cb

Please sign in to comment.