Created
June 14, 2017 06:05
-
-
Save horie1024/f20360097956284f38a69c2834ab5c5b 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
const request = require('request'); | |
module.exports = (robot) => { | |
robot.hear(/六曜/, (msg) => { | |
request.get({ | |
url: 'http://api.sekido.info/qreki?output=json', | |
headers: { | |
'User-Agent': 'Hubot' | |
} | |
}, (err, res, body) => { | |
let parsedBody = JSON.parse(body); | |
console.log(parsedBody.rokuyou_text); | |
msg.send(`今日は${JSON.parse(body).rokuyou_text}です`); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment