Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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