Skip to content

Instantly share code, notes, and snippets.

@pgmot
Created July 27, 2014 12:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgmot/0d7da948a205320f2303 to your computer and use it in GitHub Desktop.
Save pgmot/0d7da948a205320f2303 to your computer and use it in GitHub Desktop.
# 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