From 8153e727479be5a61bc35e9bce6307f8a56fbe36 Mon Sep 17 00:00:00 2001 From: overtorment Date: Tue, 25 Apr 2023 14:27:12 +0100 Subject: [PATCH] REF: mass send script --- scripts/mass_send.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/mass_send.js b/scripts/mass_send.js index de5dc53..f9f023c 100644 --- a/scripts/mass_send.js +++ b/scripts/mass_send.js @@ -3,13 +3,16 @@ const fs = require("fs"); const text = fs.readFileSync("all_tokens_unique.csv", { encoding: "utf8" }); const lines = text.split("\n"); +console.log('# got', lines.length, 'tokens'); console.log("INSERT INTO send_queue_2 VALUES "); -for (const line of lines.slice(50000, 60000)) { +let fisrt = true; +for (const line of lines.slice(0, 1000000)) { const [token, os] = line.split("\t"); - const sql = `(null, '{"type":5,"token":"${token}","os":"${os}","text":"If you are using Lightning, please read our blog post. The service is sunsetting. Balances should be moved to another service"}', null), `; + const sql = (fisrt ? '' : ', ') + `(null, '{"type":5,"token":"${token}","os":"${os}","text":"If you are using Lightning, please read our blog post. The service is sunsetting. Balances should be moved to another service"}', null)`; console.log(sql); + fisrt = false; } console.log(";");