Skip to content

Instantly share code, notes, and snippets.

@tondol
Last active August 29, 2015 14:15
Show Gist options
  • Save tondol/c1190c1e67efb3f1c3e3 to your computer and use it in GitHub Desktop.
Save tondol/c1190c1e67efb3f1c3e3 to your computer and use it in GitHub Desktop.
kssn.coffee
request = require 'request'
cheerio = require 'cheerio'
module.exports = (robot) ->
robot.respond /kssn/i, (msg) ->
url = "http://www.eventernote.com/actors/3562"
options =
url: url
timeout: 2000
headers: {'user-agent': 'eventernote scraper'}
request options, (error, response, body) ->
$ = cheerio.load body
elements = $('.gb_event_list li')[0]
date = elements.find('.date').text()
time = elements.find('.time').text()
title = elements.find('h4 a').text()
place = elements.find('.place a').text()
msg.send(title + " - " + date + " - " + time + " - " + place)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment