Skip to content

Instantly share code, notes, and snippets.

@dalehamel
Created January 5, 2015 20:40
Show Gist options
  • Save dalehamel/88f041647188af123511 to your computer and use it in GitHub Desktop.
Save dalehamel/88f041647188af123511 to your computer and use it in GitHub Desktop.
Datadog Snapshot poll
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