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
/** | |
* @see http://blog.64p.org/entry/2013/02/21/121830 | |
* @see http://mattn.kaoriya.net/software/vim/20130221123856.htm | |
* @see http://yuroyoro.hatenablog.com/entry/2013/02/21/144004 | |
* @see http://ymotongpoo.hatenablog.com/entry/2013/02/21/160646 | |
* @see http://d.hatena.ne.jp/syohex/20130221/1361423585 | |
* @see http://blog.livedoor.jp/dankogai/archives/51855038.html | |
* @see http://d.hatena.ne.jp/hasegawayosuke/20130221 | |
* @see https://gist.github.com/tk0miya/5002917 | |
* @see http://app2641.hatenablog.com/entry/2013/02/21/161928 |
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') | |
iconv = require('iconv-jp') | |
module.exports = (robot) -> | |
robot.hear /http(s?):\/\/(.*)/i, (msg) -> | |
url = msg.match[0] | |
unless url.match(/\.(png|jpg|jpeg|gif|txt|zip|tar\.bz|js|css)/) # filter out some common files from trying |
NewerOlder