Skip to content

Instantly share code, notes, and snippets.

@schaitanya
Last active December 27, 2015 03:08
Show Gist options
  • Select an option

  • Save schaitanya/7256667 to your computer and use it in GitHub Desktop.

Select an option

Save schaitanya/7256667 to your computer and use it in GitHub Desktop.
request = require 'request'
async = require 'async'
url = "http://letsrevolutionizetesting.com/challenge.json"
id = null
message = null
async.whilst ->
not message?
, (callback) ->
oUurl = url
oUurl += "?id=#{id}" if id?
request oUurl, (err, res, body) =>
body = JSON.parse(body)
follow = body.follow
unless follow?
message = body.message
return callback()
id = follow.split('id=')[1]
callback()
, (err) ->
console.log 'Error: ', err if err
console.log message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment