-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpushReputation.js
More file actions
112 lines (111 loc) · 3.69 KB
/
pushReputation.js
File metadata and controls
112 lines (111 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import inquirer from 'inquirer';
import fs from 'fs';
import { randomUUID } from 'crypto';
import random from 'random';
import { loggerFailed, loggerSuccess, loggerInfo } from './src/utils/logger.js';
import delay from './src/utils/delay.js';
import getMe from './src/func/getMe.js';
import castHome from './src/func/castHome.js';
import likeCast from './src/func/likeCast.js';
import recastCast from './src/func/recastCast.js';
const clear = () => {
process.stdout.write('\x1Bc');
};
(async () => {
try {
clear();
const jsonList = fs.readFileSync('acc.json');
const listed = JSON.parse(jsonList);
const listLive = [];
const listDie = [];
loggerInfo(`Checking each list token`);
for await (const [index, list] of listed.entries()) {
try {
loggerInfo(`check ${listed[index].username} token`);
const me = await getMe(list.token);
loggerSuccess(`${me.result.user.username} token LIVE`);
listLive.push({
username: me.result.user.username,
token: list.token,
fid: me.result.user.fid,
});
} catch (error) {
loggerFailed(`${listed[index].username} token DIE`);
listDie.push({
username: list.username,
token: list.token,
});
}
}
if (listDie.length !== 0) {
loggerFailed(
`Found ${listDie.length} token expired or die, please fix first`
);
console.log(listDie);
return;
}
clear();
console.log(`
+++++++++++++++++++++++++++++++++++++++++++
+ +
+ +
+ WARPCAST PUSH REPUTATION +
+ MADE WITH ♡ BY JANEXMGD +
+ +
+ +
+++++++++++++++++++++++++++++++++++++++++++
`);
while (true) {
const list = listLive.map((item) => item.username);
const { selected } = await inquirer.prompt({
type: 'list',
message: 'Select username to create cast',
name: 'selected',
choices: list,
});
const selectedUser = listLive.find((item) => item.username === selected);
const { token } = selectedUser;
const { inputCast } = await inquirer.prompt({
type: 'input',
message: 'Input your text to cast',
name: 'inputCast',
});
const doCast = await castHome(token, inputCast);
loggerSuccess(`Success creating cast (${doCast.result.cast.hash})`);
const targetCast = {
author: doCast.result.cast.author.username,
hash: doCast.result.cast.hash,
};
const listNotContainAuthor = listLive.filter(
(item) => item.username != targetCast.author
);
// change listNotContainAuthor to listLive is you want include accont who create cast
for (const acc of listNotContainAuthor) {
try {
loggerInfo(`interact with ${acc.username}`);
loggerInfo(`trying like cast (${targetCast.hash})`);
await likeCast(acc.token, targetCast.hash, randomUUID());
loggerInfo(`trying recast cast (${targetCast.hash})`);
await recastCast(acc.token, targetCast.hash, randomUUID());
const int = random.integer(5, 7);
const ms = int * 1000;
await delay(ms);
} catch (error) {
loggerFailed(`fail using ${acc.username}` || error.message);
}
}
const { isMore } = await inquirer.prompt({
type: 'confirm',
message: 'do you want other account ?',
name: 'isMore',
});
if (isMore) {
continue;
}
break;
}
} catch (error) {
loggerFailed(error.message);
console.error(error);
}
})();