Forget Script
This commit is contained in:
parent
10161220e6
commit
e1456cb769
1 changed files with 33 additions and 0 deletions
33
forget.py
Normal file
33
forget.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
import requests
|
||||
|
||||
#Customize for your instance, must be changed for it to work!!
|
||||
token = "<Your Token here>"
|
||||
UserID = "<Your UserID here>"
|
||||
NoteEndpoint = "https://fedi.catboy.agency/api/users/notes"
|
||||
DeleteEndpoint = "https://fedi.catboy.agency/api/notes/delete"
|
||||
|
||||
PostsLeft = True
|
||||
|
||||
while PostsLeft:
|
||||
cycleAmount = 99 #max is 99 normally
|
||||
|
||||
headers = {"Content-Type": "application/json; charset=utf-8"}
|
||||
data = {"userId":UserID,"withRenotes":True,"withReplies":True,"withChannelNotes":True,"withFiles":False,"limit":cycleAmount,"i":token}
|
||||
|
||||
r = requests.post(url=NoteEndpoint, headers=headers, json=data)
|
||||
|
||||
posts = r.json()
|
||||
|
||||
if len(posts) < cycleAmount:
|
||||
PostsLeft = False
|
||||
|
||||
for post in posts:
|
||||
deleteData = {"noteId":post["id"],"i":token}
|
||||
r = requests.post(url=DeleteEndpoint, headers=headers, json=deleteData)
|
||||
print("====================================================")
|
||||
print("Delete for ["+post["id"]+"]:"+str(r.status_code))
|
||||
print(post["text"])
|
||||
print("====================================================")
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue