Last active
April 8, 2016 22:26
-
-
Save alexellis/571f47491a91894f50b2ac58e298fd2c to your computer and use it in GitHub Desktop.
RaspberryPiFinderSolution
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 request = require('request'); | |
var async = require('async'); | |
var found = []; | |
async.until(function() { | |
return false; // infinite async-loop, insert counter check here. | |
}, function(cb) { | |
request.head("https://www.raspberrypi.org/blog/the-little-computer-that-could/", | |
function(err, res, body) { | |
var servedBy = res.headers['x-served-by']; | |
if(found.indexOf(servedBy)==-1){ | |
console.log("" + servedBy); | |
found.push(servedBy); | |
} | |
cb(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment