├── reply.txt
├── .env.example
├── package.json
├── README.md
└── index.js
/reply.txt:
--------------------------------------------------------------------------------
1 | follow aku kak
2 | haiii kak
3 | follow me :D
4 | pls fllow nti ku flbck hehe
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | UNAME = 'YOUR_INSTAGRAM_USERNAME'
2 | PASSW = 'YOUR_INSTAGRAM_PASSWORD'
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "threadsfeed",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "vsec7",
10 | "license": "ISC",
11 | "dependencies": {
12 | "args": "^5.0.3",
13 | "dotenv": "^16.3.1",
14 | "threads-api": "^1.4.2"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Threads Feed Bot
2 |
3 |
4 |
5 | Auto Like, Reply, and Follow by timeline threads.net
6 |
7 | Crafted By viloid (github.com/vsec7)
8 |
9 | > *** NOTE : USE AT YOUR OWN RISK! ***
10 |
11 | ```bash
12 | ▶ node index.js -h
13 | Usage: index.js [options] [command]
14 |
15 | Commands:
16 | help Display help
17 | version Display version
18 |
19 | Options:
20 | -d, --delay Delay (defaults to 120)
21 | -f, --follow Follow (disabled by default)
22 | -h, --help Output usage information
23 | -l, --like Like (disabled by default)
24 | -r, --reply Reply (disabled by default)
25 | -v, --version Output the version number
26 |
27 | ```
28 |
29 | ## Features
30 | - Auto Like, Reply, Follow on timeline feed
31 |
32 | ## • Installation
33 | ```bash
34 | git clone https://github.com/vsec7/threadsfeed.git
35 | npm i
36 | ```
37 |
38 | ## Credentials
39 | Rename .env.example to .env
40 | ```env
41 | UNAME = 'YOUR_INSTAGRAM_USERNAME'
42 | PASSW = 'YOUR_INSTAGRAM_PASSWORD'
43 |
44 | ```
45 |
46 | ## Run
47 | ```bash
48 | # like only
49 | node index.js --like
50 |
51 | # like + follow
52 | node index.js --like --follow
53 |
54 | # sorten cmd to use all
55 | node index.js -l -r -f
56 | ```
57 |
58 | * if you used reply, edit reply.txt with your custom text.
59 |
60 | ## Unofficial Threads API Wrapper
61 | https://github.com/junhoyeo/threads-api
62 |
63 | ## Support Me
64 | EVM Address : viloid.bnb | viloid.arb
65 |
66 | SOL Address : viloid.sol
67 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 | // Crafted by github.com/vsec7
3 |
4 | const { ThreadsAPI } = require("threads-api");
5 | require("dotenv").config();
6 | const args = require('args')
7 | const fs = require("fs");
8 |
9 | args.option('like', 'Like', false)
10 | .option('reply', 'Reply', false)
11 | .option('follow', 'Follow', false)
12 | .option('delay', 'Delay', 120)
13 |
14 | const flags = args.parse(process.argv)
15 |
16 | const threadsAPI = new ThreadsAPI({
17 | username: process.env.UNAME,
18 | password: process.env.PASSW,
19 | });
20 |
21 | const timeline = async () => {
22 | const { items: threads, next_max_id: cursor } = await threadsAPI.getTimeline();
23 | return threads;
24 | }
25 |
26 | const like = async (id) => {
27 | try {
28 | await threadsAPI.like(id);
29 | console.log(`[LIKE] ${id}`);
30 | } catch (error) {
31 | console.log(`[ERROR] ${error}`);
32 | }
33 | };
34 |
35 | const reply = async (id, txt) => {
36 | try {
37 | await threadsAPI.publish({
38 | text: txt,
39 | parentPostID: id,
40 | });
41 | console.log(`[REPLY] ${id} | ${txt}`);
42 | } catch (error) {
43 | console.log(`[ERROR] ${error}`);
44 | }
45 | };
46 |
47 | const follow = async (uid) => {
48 | try {
49 | await threadsAPI.follow(uid);
50 | console.log(`[FOLLOW] ${uid}`);
51 | } catch (error) {
52 | console.log(`[ERROR] ${error}`);
53 | }
54 | };
55 |
56 | const RandomText = () => {
57 | const txt = fs.readFileSync("reply.txt", "utf8").split("\n");
58 | const rnd = Math.floor(Math.random() * txt.length);
59 | return txt[rnd];
60 | };
61 |
62 | (async () => {
63 |
64 | console.log(`[?] Logged-in As ${process.env.UNAME}`)
65 |
66 | while (true) {
67 | const getfeeds = await timeline()
68 | for (const feed of getfeeds) {
69 | const id = feed.thread_items[0].post.id
70 |
71 | if(flags.like) {
72 | await like(id)
73 | }
74 |
75 | if(flags.reply) {
76 | const mid = id.split("_")[0]
77 | const txt = RandomText()
78 | await reply(mid, txt)
79 | }
80 |
81 | if(flags.follow) {
82 | const uid = id.split("_")[1]
83 | await follow(uid)
84 | }
85 | }
86 |
87 | console.log(`--------[ Delay for ${flags.delay} Seconds ]--------`)
88 |
89 | await new Promise((resolve) =>
90 | setTimeout(resolve, flags.delay * 1000)
91 | );
92 | }
93 |
94 | })();
95 |
--------------------------------------------------------------------------------