This repository was archived by the owner on Jun 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 5
5
# None
6
6
#
7
7
# Configuration:
8
- # HUBOT_BITLY_USERNAME
9
- # HUBOT_BITLY_API_KEY
8
+ # HUBOT_BITLY_ACCESS_TOKEN
10
9
#
11
10
# Commands:
12
11
# hubot (bitly|shorten) (me) <url> - Shorten the URL using bit.ly
15
14
# Author:
16
15
# sleekslush
17
16
# drdamour
17
+ # johnwyles
18
18
19
19
module .exports = (robot ) ->
20
20
robot .respond / (bitly| shorten)\s ? (me)? \s ? (. + )$ / i , (msg ) ->
21
21
msg
22
- .http (" http ://api.bitly.com/v3/shorten" )
22
+ .http (" https ://api-ssl .bitly.com/v3/shorten" )
23
23
.query
24
- login : process .env .HUBOT_BITLY_USERNAME
25
- apiKey : process .env .HUBOT_BITLY_API_KEY
24
+ access_token : process .env .HUBOT_BITLY_ACCESS_TOKEN
26
25
longUrl : msg .match [3 ]
27
26
format : " json"
28
27
.get () (err , res , body ) ->
@@ -32,10 +31,9 @@ module.exports = (robot) ->
32
31
# TODO: can we make this list more expansive/dynamically generated?
33
32
robot .hear / (https? :\/\/ (bit\. ly| yhoo\. it| j\. mp| pep\. si| amzn\. to)\/ [0-9a-z \- ] + )/ ig , (msg ) ->
34
33
msg
35
- .http (" http ://api.bitly.com/v3/expand" )
34
+ .http (" https ://api-ssl .bitly.com/v3/expand" )
36
35
.query
37
- login : process .env .HUBOT_BITLY_USERNAME
38
- apiKey : process .env .HUBOT_BITLY_API_KEY
36
+ access_token : process .env .HUBOT_BITLY_ACCESS_TOKEN
39
37
shortUrl : msg .match
40
38
.get () (err , res , body ) ->
41
39
parsedBody = JSON .parse body
You can’t perform that action at this time.
0 commit comments