Skip to content

Instantly share code, notes, and snippets.

@horie1024
Created June 14, 2017 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horie1024/f20360097956284f38a69c2834ab5c5b to your computer and use it in GitHub Desktop.
Save horie1024/f20360097956284f38a69c2834ab5c5b to your computer and use it in GitHub Desktop.
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