forked from chenchenwuai/tieba-delete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
59 lines (48 loc) · 1.56 KB
/
index.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
// const { getReplys } = require('./reply');
// const { deleteReplys } = require('./delete');
const fs = require("fs");
const { getTBS } = require('./src/utils')
const config = require('./config')
const { deleteReplies } = require('./src/deleteReply')
const { deletePosts } = require('./src/deletePost')
const { deleteConcerns } = require('./src/deleteConcern')
const { deleteTieba } = require('./src/deleteTieba')
const { deleteFans } = require('./src/deleteFans')
const cookie = fs.readFileSync('./cookie');
(async () => {
if(!cookie){
console.error('无效的cookie!')
return false
}
const tbs = await getTBS()
if(!tbs){
console.error('cookie失效,请重新登陆,然后设置cookie!')
return false
}
const { reply, post, concern, tieba, fans } = config
if(reply.enable){
console.log('---------------------------------------')
console.log('开始删除评论...')
await deleteReplies(reply)
}
if(post.enable){
console.log('---------------------------------------')
console.log('开始删除帖子...')
await deletePosts(post)
}
if(concern.enable){
console.log('---------------------------------------')
console.log('开始取消关注的人...')
await deleteConcerns(concern)
}
if(tieba.enable){
console.log('---------------------------------------')
console.log('开始取消关注的贴吧...')
await deleteTieba(tieba)
}
if(fans.enable){
console.log('---------------------------------------')
console.log('开始移除粉丝...')
await deleteFans(fans)
}
})();