Forget Script

This commit is contained in:
Venrey 2024-04-05 23:24:26 +00:00
parent 10161220e6
commit e1456cb769

33
forget.py Normal file
View 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("====================================================")