diff --git a/package.json b/package.json index 441ef9f..c876086 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ }, "dependencies": { "aws-sdk": "^2.0.23", - "chart.js": "^2.2.2", "cheerio": "^0.22.0", "githubot": "^1.0.0-beta2", "hubot": ">= 2.6.0 < 3.0.0", diff --git a/scripts/chart.coffee b/scripts/chart.coffee index 1b5b13d..2b7c5b5 100644 --- a/scripts/chart.coffee +++ b/scripts/chart.coffee @@ -11,7 +11,7 @@ # path = require('path') # ChartImage = require('../module/chart_image') # -# module.exports = (robot) -> +module.exports = (robot) -> # # robot.helper = # url: () -> diff --git a/scripts/lgtm.coffee b/scripts/lgtm.coffee index ee91029..5f7c243 100644 --- a/scripts/lgtm.coffee +++ b/scripts/lgtm.coffee @@ -12,11 +12,11 @@ cheerio = require('cheerio') module.exports = (robot) -> # Looks good to me! - robot.hear /lgtm/i, (msg) -> + robot.respond /lgtm/i, (msg) -> robot.http("http://www.lgtm.in/g") .get() (err, res, body) -> if res.statusCode is 302 - robot.http(res.headers.location) + robot.http(res.headers.location, { rejectUnauthorized: false }) .get() (err, res, body) -> $ = cheerio.load(body) msg.send $('#imageUrl').attr('value') diff --git a/test/lgtm_test.coffee b/test/lgtm_test.coffee index 88c2e83..c6f4f2d 100644 --- a/test/lgtm_test.coffee +++ b/test/lgtm_test.coffee @@ -1,10 +1,10 @@ source = '../scripts/lgtm' expect = require('chai').expect -Robot = require('hubot/src/robot') +Robot = require('hubot/src/robot') TextMessage = require('hubot/src/message').TextMessage -describe 'lgtm', -> +describe 'lgtm', -> robot = null user = null adapter = null @@ -31,7 +31,7 @@ describe 'lgtm', -> catch e done e - adapter.receive(new TextMessage(user, 'lgtm')) + adapter.receive(new TextMessage(user, 'hubot lgtm')) it 'should respond to a tiqav image', (done) -> adapter.on 'send', (envelope, strings) ->