Merge branch 'main' of https://github.com/pogmom/TwitToMast
This commit is contained in:
commit
4761335176
2 changed files with 35 additions and 14 deletions
42
multi.js
42
multi.js
|
@ -1,15 +1,29 @@
|
||||||
const args = process.argv;
|
const childProcess = require('child_process')
|
||||||
const defArgs = ["node","path","name","tweetCount","0","write","printHeader"]
|
const path = require('path');
|
||||||
for (var i = 0; i < 2; i++) {args.shift();}
|
async function fork(scriptPath, args = []) {
|
||||||
const config = require('fs').readFileSync("./usernameslist.txt").toString().split(/[\r\n]+/);
|
return new Promise((resolve, reject) => {
|
||||||
for (let name of config) {
|
let process = childProcess.fork(scriptPath, args, {
|
||||||
var pArgs = [...args];
|
cwd: path.dirname(scriptPath)
|
||||||
pArgs.splice(0, 0, name);
|
});
|
||||||
for (var i = 3; i < 7; i++) {
|
|
||||||
if (typeof pArgs[i-2] == 'undefined') {
|
process.on('exit', code => resolve(code));
|
||||||
pArgs.push(defArgs[i]);
|
process.on('error', err => reject(err));
|
||||||
}
|
});
|
||||||
}
|
|
||||||
console.log("pArgs: " + pArgs);
|
|
||||||
require('child_process').fork('./TwitToMast.js',pArgs);
|
|
||||||
}
|
}
|
||||||
|
(async function(){
|
||||||
|
const args = process.argv;
|
||||||
|
const defArgs = ["node","path","name","tweetCount","0","write","fromLoop"]
|
||||||
|
for (var i = 0; i < 2; i++) {args.shift();}
|
||||||
|
const config = require('fs').readFileSync("./usernameslist.txt").toString().split(/[\r\n]+/);
|
||||||
|
for (let name of config) {
|
||||||
|
var pArgs = [...args];
|
||||||
|
pArgs.splice(0, 0, name);
|
||||||
|
for (var i = 3; i < 7; i++) {
|
||||||
|
if (typeof pArgs[i-2] == 'undefined') {
|
||||||
|
pArgs.push(defArgs[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("pArgs: " + pArgs);
|
||||||
|
await fork('./TwitToMast.js', pArgs);
|
||||||
|
}
|
||||||
|
}());
|
||||||
|
|
|
@ -3,3 +3,10 @@ Twitter
|
||||||
TwitterCreators
|
TwitterCreators
|
||||||
TwitterSupport
|
TwitterSupport
|
||||||
TwitterAPI
|
TwitterAPI
|
||||||
|
TwitterSafety
|
||||||
|
verified
|
||||||
|
TwitterBlue
|
||||||
|
TwitterDesign
|
||||||
|
TwitterEng
|
||||||
|
Policy
|
||||||
|
TwitterDev
|
||||||
|
|
Reference in a new issue