Created
September 1, 2015 07:53
-
-
Save gor181/1496d5d65e11469733f1 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
var http = require('http'); | |
function follow(url, cb) { | |
http.get(url, function(res) { | |
res.on('data', function (chunk) { | |
var data = JSON.parse(chunk.toString()); | |
if (!data || !data.follow) { | |
cb(data); | |
return; | |
} | |
follow(data.follow.replace('challenge?', 'challenge.json?'), cb); | |
}); | |
}); | |
} | |
follow('http://letsrevolutionizetesting.com/challenge.json', function (data) { | |
console.log(data.message); | |
}); | |
//Congratulations! You've reached the end! You have passed our simple little test and we would love to hear from you. Please save the code you used to a private gist, and fill out the quick application form at https://jobs.lever.co/rainforest. We'll be in touch shortly! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment