Created
July 27, 2014 12:35
-
-
Save pgmot/0d7da948a205320f2303 to your computer and use it in GitHub Desktop.
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
# Description: | |
# syussya | |
# | |
# Dependencies: | |
# "request" | |
# "cheerio" | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# hubot syussya - syussya | |
# | |
# Author: | |
# programmerMOT | |
request = require 'request' | |
cheerio = require 'cheerio' | |
module.exports = (robot) -> | |
robot.respond /syussya/i, (msg) -> | |
url = "http://shindanmaker.com/311937" | |
username = Math.floor(Math.random()*100000000+1) | |
options = | |
headers: {'content-type' : 'application/x-www-form-urlencoded'} | |
url: url | |
timeout: 2000 | |
body: "u="+username+"&from=" | |
request.post options, (error, response, body) -> | |
$ = cheerio.load body | |
result = $("div.result > div").text().replace(/\n/g, "").replace(/\t/g, "") | |
msg.send(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment