This repository was archived by the owner on Apr 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathfftdmbetaauto.js
126 lines (113 loc) · 5.57 KB
/
fftdmbetaauto.js
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
const { chalk, inquirer, _, fs, instagram, print, delay } = require("./index.js");
(async () => {
print(
chalk`{bold.green
▄▄▄▄▄ ▄▄▌ .▄▄ · ▪ ▄▄ •
•██ ▪ ▪ ██• ▐█ ▀. ██ ▐█ ▀ ▪
▐█.▪ ▄█▀▄ ▄█▀▄ ██▪ ▄▀▀▀█▄▐█·▄█ ▀█▄ [fftdm]
▐█▌·▐█▌.▐▌▐█▌.▐▌▐█▌▐▌▐█▄▪▐█▐█▌▐█▄▪▐█ [BETA]
▀▀▀ ▀█▄▀▪ ▀█▄▀▪.▀▀▀ ▀▀▀▀ ▀▀▀·▀▀▀▀
Ξ TITLE : Folow Like Direct Message (Followers Target)
Ξ NOTE : U can add more targets, use u best ratio!
Ξ UPDATE : Wednesday, August 4, 2021 (GMT+8)
: TESTED "OK" BUG? YouTellMe!
}`
);
const questions = [
{
type: "input",
name: "username",
message: "Input username:",
validate: (val) => val.length != 0 || "Please input username!",
},
{
type: "password",
name: "password",
mask: "*",
message: "Input password:",
validate: (val) => val.length != 0 || "Please input password!",
},
{
type: "input",
name: "targets",
message: "Input target's username (without '@' more? '|'):",
validate: (val) => val.length != 0 || "Please input target's username!",
},
{
type: "input",
name: "inputMessage",
message: "Input text's message (more? '|') :",
validate: (val) => val.length != 0 || "Please input text's Message!",
},
{
type: "input",
name: "perExec",
message: "Input limit per-execution:",
validate: (val) => /[0-9]/.test(val) || "Only input numbers",
},
{
type: "input",
name: "delayTime",
message: "Input sleep time (in milliseconds):",
validate: (val) => /[0-9]/.test(val) || "Only input numbers",
},
];
try {
const { username, password, targets, perExec, delayTime, inputMessage } = await inquirer.prompt(questions);
let targetarray = targets.split("|");
const ig = new instagram(username, password);
const login = await ig.login();
let targetuser = "";
print("Try to Login . . .", "wait", true);
print(`Logged in as @${login.username} (User ID: ${login.pk})`, "ok");
targetarray.forEach((user) => {
targetuser += `@${user} ,`;
});
targetuser = targetuser.slice(0, -1);
print(`Collecting information of ${targetuser} . . .`, "wait");
targetarray.forEach(async (target) => {
const id = await ig.getIdByUsername(target);
const info = await ig.userInfo(id);
if (info.is_private) {
print(`@${target} is private account`, "err");
return false;
}
print(`@${target} (User ID: ${id}) => Followers: ${info.follower_count}, Following: ${info.following_count}`, "ok");
});
print("Collecting followers . . .", "wait");
let endOffLoop = false;
do {
const id = await ig.getIdByUsername(targetarray[Math.floor(Math.random() * targetarray.length)].trim(""));
const targetFollowers = await ig.followersFeed(id);
const usertargetfrom = await ig.userInfo(id);
let items = await targetFollowers.items();
items = _.chunk(items, perExec);
await Promise.all(
items[Math.floor(Math.random() * items.length)].map(async (follower) => {
const status = await ig.friendshipStatus(follower.pk);
if (!follower.is_private && !status.following && !status.followed_by) {
const media = await ig.userFeed(follower.pk),
lastMedia = await media.items();
const text = inputMessage.split("|");
const msg = text[Math.floor(Math.random() * text.length)];
if (lastMedia.length != 0 && lastMedia[0].pk) {
const task = [ig.follow(follower.pk), ig.like(lastMedia[0].pk), ig.sendDirectMessage(follower.pk, msg)];
let [follow, like, dm] = await Promise.all(task);
follow = follow ? chalk.bold.green(`Follow`) : chalk.bold.red("Follow");
like = like ? chalk.bold.green("Like") : chalk.bold.red("Like");
dm = dm ? chalk.bold.green("DM") : chalk.bold.red("DM");
print(`▲ @${usertargetfrom.username} follower @${follower.username} ⇶ [${follow}, ${like}, ${dm}] ⇶ ${chalk.cyanBright(msg)}`);
} else print(chalk`▼ @${usertargetfrom.username} follower @${follower.username} ⇶ {yellow No posts yet, Skip.}`);
} else print(chalk`▼ @${usertargetfrom.username} follower @${follower.username} ⇶ {yellow Private or already followed/follows you, Skip.}`);
})
);
print(`Current Account: (${login.username}) » Delay: ${perExec}/${delayTime}ms \n`, "wait", true);
await delay(delayTime);
endOffLoop = targetFollowers.moreAvailable;
} while (endOffLoop);
print(`Status: All Task done!`, "ok", true);
} catch (err) {
print(err, "err");
}
})();
//by 1dcea8095a18ac73b764c19e40644b52 116 111 111 108 115 105 103 118 51