Skip to content

Instantly share code, notes, and snippets.

@brianherman
Created April 15, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianherman/f777dc076bd589e7ebb9c626e13ab009 to your computer and use it in GitHub Desktop.
Save brianherman/f777dc076bd589e7ebb9c626e13ab009 to your computer and use it in GitHub Desktop.
challenge
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('https://letsrevolutionizetesting.com/challenge.json', function (data) {
console.log(data.message);
});
//https://letsrevolutionizetesting.com/challenge?id=995287801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment