← back to Norma
agents/instagram-agent/reshare-fleet.js
27 lines
#!/usr/bin/env node
/**
* reshare-fleet.js — run the per-account reshare across the CURRENT PHASE's accounts, paced.
* Phase list in data/reshare-phase.json (grow it as accounts prove safe). Each account is
* capped at 6/day by hashtag-reshare.js itself; this just cycles the phase, spaced ~90s apart
* so a fleet run never bursts (velocity safety).
* node reshare-fleet.js # DRY (each account dry)
* node reshare-fleet.js --go # LIVE
*/
const { execFileSync } = require('child_process');
const path = require('path');
const fs = require('fs');
const GO = process.argv.includes('--go');
const { phase, accounts } = JSON.parse(fs.readFileSync(path.join(__dirname, 'data', 'reshare-phase.json'), 'utf8'));
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
(async () => {
console.log(`Reshare fleet — phase ${phase} — ${accounts.length} accounts — ${GO ? 'LIVE' : 'DRY'}`);
for (let i = 0; i < accounts.length; i++) {
const a = accounts[i];
try {
const out = execFileSync(process.execPath, [path.join(__dirname, 'hashtag-reshare.js'), a, '--n', '2', ...(GO ? ['--go'] : [])], { encoding: 'utf8' });
console.log(out.trim().split('\n').filter((l) => /reshared|pick|✓|✗|cap|Skip/.test(l)).join('\n'));
} catch (e) { console.log(`@${a}: ${String(e.message).split('\n')[0]}`); }
if (GO && i < accounts.length - 1) await sleep(90000); // 90s between accounts
}
})();