Last active
August 29, 2015 14:15
-
-
Save tondol/c1190c1e67efb3f1c3e3 to your computer and use it in GitHub Desktop.
kssn.coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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