-
-
Save atmos/1318381 to your computer and use it in GitHub Desktop.
hubot script to insert images from bukk.it
This file contains hidden or 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
# lulz - BRING THE LOLZ from bukk.it | |
Select = require("soupselect").select | |
HtmlParser = require "htmlparser" | |
util = require 'util' | |
module.exports = (robot) -> | |
robot.respond /l[ou]lz/i, (msg) -> | |
msg.http("http://bukk.it") | |
.get() (err, res, body) -> | |
handler = new HtmlParser.DefaultHandler() | |
parser = new HtmlParser.Parser handler | |
parser.parseComplete body | |
results = ("http://bukk.it/#{link.attribs.href}" for link in Select handler.dom, "td a") | |
msg.send msg.random results |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment