Created
January 5, 2015 20:40
-
-
Save dalehamel/88f041647188af123511 to your computer and use it in GitHub Desktop.
Datadog Snapshot poll
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
checklength = (url) -> | |
robot.http(result['snapshot_url']).get() (err,res,body) -> | |
size = res['headers']['content-length'] | |
checklength url unless size > 1000 | |
if size > 1000 | |
setTimeout -> | |
msg.send "Here's your graph for #{dash} #{graph}, #{msg.message.user.name}: #{result['snapshot_url']}" | |
, 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment