Skip to content

anonymous /node_img_dl.js secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Download multiple files node.js
var fs=require('fs');
var http=require('http');
dl('/wikipedia/commons/1/15/Jagdschloss_Granitz_4.jpg','name.jpeg');
dl('/wikipedia/commons/9/93/Cold_Bay_Izembek_NWR.jpg','name2.jpeg');
function dl(path,file){
var f=fs.createWriteStream(file);
var options={
host:'upload.wikimedia.org',
port:80,
path:path
}
http.get(options,function(res){
res.on('data', function (chunk) {
f.write(chunk);
});
res.on('end',function(){
f.end();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.