Created
October 14, 2015 02:10
-
-
Save horie1024/1506ef6cc7314bd3a072 to your computer and use it in GitHub Desktop.
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
aws = require 'aws-sdk' | |
robot.catchAll (msg) -> | |
matches = msg.message.text.match(/@vasilybot\s*(.*)/) | |
if matches == null or matches.length == 0 | |
return | |
runArn = matches[1] | |
msg.send 'ok, start watching run.' | |
devicefarm = new aws.DeviceFarm({region: 'us-west-2'}) | |
timer = setInterval -> | |
devicefarm.getRun {arn: runArn}, (err, data) -> | |
if data == null | |
msg.send "Invalid parameter. Please check the value of ARN." | |
clearInterval(timer) | |
return | |
if data.run.status == 'COMPLETED' | |
msg.send 'Result: ' + data.run.result | |
clearInterval(timer) | |
, 60000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment