Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/chart.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# path = require('path')
# ChartImage = require('../module/chart_image')
#
# module.exports = (robot) ->
module.exports = (robot) ->
#
# robot.helper =
# url: () ->
Expand Down
4 changes: 2 additions & 2 deletions scripts/lgtm.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions test/lgtm_test.coffee
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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) ->
Expand Down