Last active
December 27, 2015 03:08
-
-
Save schaitanya/7256667 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
| 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