Created
May 4, 2015 19:47
-
-
Save nanonanomachine/3625882fbebedba38556 to your computer and use it in GitHub Desktop.
ピックアップレシピ表示してくれるやつ
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
cron = require('cron').CronJob | |
client = require 'cheerio-httpcli' | |
module.exports = (robot) -> | |
# テスト用 | |
#job = new cron '*/1 * * * *', () => | |
job = new cron '00 07 * * * ', () => | |
robot.logger.debug "pickup_recipes fetch start" | |
client.fetch 'http://cookpad.com/pickup_recipes', (err, $, res) -> | |
robot.send {room: "recipe"}, $('title').text() | |
$('.recipe_title').each (idx) -> | |
robot.send {room: "recipe"}, 'http://cookpad.com' + $(this).attr('href') | |
job.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment