Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #210 from Airborn/patch-1

Makes 'me' optional in shorten script
  • Loading branch information...
commit ccbf4cb37d47acf2ac3a087c5de8bd62600ddef3 2 parents 5775cbe + c032cfe
@tombell tombell authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/scripts/shorten.coffee
View
4 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
Please sign in to comment.
Something went wrong with that request. Please try again.