this post was submitted on 08 Jun 2023
130 points (100.0% liked)

World News

1110 readers
2 users here now

Breaking news from around the world.

News that is American but has an international facet may also be posted here.


Guidelines for submissions:

These guidelines will be enforced on a know-it-when-I-see-it basis.


For US News, see the US News community.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

RIF will be shutting down on June 30, 2023, in response to Reddit Inc's API changes and their hostile treatment of developers building on their platform.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 1 year ago* (last edited 1 year ago)

It is a python script, you need the praw library. The client id’s are given in your profile after you create an app.

  
import praw

reddit = praw.Reddit(client_id='yourid',
	client_secret='yoursecret',
	password='your password',
	user_agent='deletes my comments',
	username='your username')

redditor = reddit.redditor("your username")

for comment in redditor.comments.top(limit=10000):
	comment.edit("deleted")
	comment.delete()

You can edit and delete everything in the same pass but I prefer to overwrite my comments first and give time for the cache machines to register my new garbage before deleting with another pass.