Skip to content

Commit

Permalink
REF: mass send script
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Apr 25, 2023
1 parent 55f7c47 commit 8153e72
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/mass_send.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(";");

0 comments on commit 8153e72

Please sign in to comment.