Skip to content

Instantly share code, notes, and snippets.

@sepulworld
Last active August 29, 2015 14:19
Show Gist options
  • Save sepulworld/951ad196459f7fcce453 to your computer and use it in GitHub Desktop.
Save sepulworld/951ad196459f7fcce453 to your computer and use it in GitHub Desktop.
warm_urls.js
#!/usr/bin/env node
YAML = require('yamljs');
getURLs = YAML.load('url-list.yaml');
var http = require('http');
getURLs[':urls'].forEach(function (element) {
http.get(element, function(res) {
console.log("http get... " + element);
console.log("Got response: " + res.statusCode );
res.on('data', function(chunk) {
//console.log('BODY: ' + chunk);
});
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment