Skip to content

Instantly share code, notes, and snippets.

@ravinhwg
Last active November 5, 2019 21:32
Show Gist options
  • Save ravinhwg/bdf4f4c565b1eadf1324d2f43bf850c6 to your computer and use it in GitHub Desktop.
Save ravinhwg/bdf4f4c565b1eadf1324d2f43bf850c6 to your computer and use it in GitHub Desktop.
Make a list of images
/*
Written by Ravin Hewage.
*/
let fs = require('fs'); //import node file system api
let count; //initialise the counter.
let paddedcount; //pading the counter
for(count=0;count<244;count++){
//adding 3 zeros in front of the number in the url so 1 would be 0001
Number.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
}
//end of promise
paddedCount = (count).pad(4);
let url = `http://www.content-b-xy.net/albums/mcsocial-2018-da/XY_DA_${paddedCount}.jpg`+"\n";
fs.appendFileSync('url_set.txt',url,function(e){
if(e){
throw(e);
}
});
console.log(url);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment