Skip to content

Instantly share code, notes, and snippets.

@epk
Created February 28, 2018 17:07
Show Gist options
  • Save epk/1a45caee81f80c3508f9cf31579345a3 to your computer and use it in GitHub Desktop.
Save epk/1a45caee81f80c3508f9cf31579345a3 to your computer and use it in GitHub Desktop.
var host="somehost";
var request = require('request');
var myMap = new Map();
for(var i = 2 ; i<process.argv.length; i++){
let orig = process.argv[i];
//console.log(orig);
let r = request.get(host+process.argv[i], function (err, res, body) {
//console.log(r.uri.href);
rs = r.uri.href.split("/");
rs1 = "../../images/" + rs[rs.length-1];
myMap.set(orig,rs1);
console.log(myMap);
});
}
console.log("Done");
console.log(myMap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment