Skip to content

Commit

Permalink
whatever, use imgur
Browse files Browse the repository at this point in the history
  • Loading branch information
ajb committed Mar 3, 2016
1 parent d5e16d6 commit 9ada9f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"hubot-github-todos": "0.4.0",
"hubot-irc": "^0.2.7",
"hubot-scripts": "2.5.11",
"imgur": "^0.1.7",
"nightmare": "^1.7.0",
"prettyjson": "^1.1.3",
"request": "~2.34.0",
Expand Down
5 changes: 4 additions & 1 deletion scripts/startup_generator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ _ = require('underscore')
os = require('os')
request = require('request')
fs = require('fs')
imgur = require('imgur')

module.exports = (robot) ->
robot.hear /startup me/i, (msg) ->
Expand Down Expand Up @@ -178,6 +179,8 @@ module.exports = (robot) ->
url = "https://api.browshot.com/api/v1/screenshot/thumbnail?id=#{id}&key=#{apiKey}&left=#{x_coord}&right=#{x_coord + 300}&top=#{y_coord}&bottom=#{y_coord + 200}&width=300&height=200"
request url, (_err, _res, _body) ->
setTimeout ->
msg.send "Introducing... #{name}.\n#{url}"
imgur.setCredentials('[email protected]', 'zjzpMdA24soxCjV', 'bf98dd8050855c2')
imgur.uploadUrl(url).then (json) ->
msg.send "Introducing... #{name}.\n#{json.data.link}"
, 2000
, 4000 # for first screenshot to complete

0 comments on commit 9ada9f7

Please sign in to comment.