[Freebie] Mass wget with Node.JS

lumi

Member
Reputation
0
I made this cause at the time I didn't know you could wget from a list by default and I wanted something simple to make in node.

Code:
var util = require('util'),
	exec = require('child_process').exec,
	child;
var prompt = require('prompt');
var fs = require('fs');

prompt.start();

prompt.get(['urls'], function (err, result){
	console.log('Ok, you want to download from ' + result.urls);
	console.log('gotta go fast xdddddddddddddddddddddddddddddddddd');

	fs.readFile(result.urls, function read(err, urls){

			var formatted = urls.toString().split(",");
				//console.log(urls);
				for(i in formatted){

						child = exec('wget ' + formatted[i], function (error, stdout, stderr) {
							console.log('stdout: ' + stdout);
							console.log('stderr: ' + stderr);
							if(error !== null) {
								console.log('exec error: ' + error);
							}
						});
				}

	})
});

If you don't know how node.js works then this isn't a script for you.

the package prompt is required

Code:
npm install prompt
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…