Created
April 15, 2021 18:15
-
-
Save brianherman/f777dc076bd589e7ebb9c626e13ab009 to your computer and use it in GitHub Desktop.
challenge
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('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