Created
June 30, 2015 21:35
-
-
Save noir-neo/096f9356c97775c77627 to your computer and use it in GitHub Desktop.
たび先輩のvineを拾ってきてくれるhubotスクリプト
This file contains hidden or 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
| module.exports = (robot) -> | |
| robot.respond /(tabi|たび)/i, (msg) -> | |
| robot.http("https://api.vineapp.com/timelines/users/1038468495395958784") # ざわちゃんのuserid | |
| .get() (err, res, body) -> | |
| records = JSON.parse(body)['data']['records'] | |
| tabis = [] | |
| for record in records | |
| # ざわちゃんは複数タグつけないと思うので配列0ハードで | |
| if record.entities[0]?.id == 1138830969860853760 # tag"#たび"のid | |
| tabis.push(record.shareUrl) | |
| msg.send msg.random tabis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment