Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active April 8, 2016 22:26
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 alexellis/571f47491a91894f50b2ac58e298fd2c to your computer and use it in GitHub Desktop.
Save alexellis/571f47491a91894f50b2ac58e298fd2c to your computer and use it in GitHub Desktop.
RaspberryPiFinderSolution
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