Delete all comments/posts from the GDPR request
I don't know. This is still very early code. Please contribute to improve it!
When accessing the reddit API only the most recent 1000 comments are returned. This script allows to delete all comments included in the GDPR request.
The script tries to delete all comments in the given csv file and then check if they were deleted. If they weren't it retries to delete it. This script cannot delete any comments not in the GDPR request, if such comments would exist.
DO NOT SHARE your config.json file with anyone under any circumstances!
- Go to https://www.reddit.com/settings/data-request and request your data
- Wait until you receive it (can take up to 30 days)
- Run the python script once, this will create the config.json where you will add your credentials
- Go to https://www.reddit.com/prefs/apps, click "create another app...", give it a random name and select "script", add a redirect uri (http://reddit.com worked for me), press "create app"
- Add the string below "personal use script" to the JSON file as the reddit_client_id
- Add the string after "secret" to the JSON file as the reddit_client_secret
- Add your Reddit username and password to the JSON file
- Put the csv file from the GDPR request with post that you want to delete in the same folder as reddit_delete.py
- Change file_path in reddit_delete.py to that file
- Rerun the script
- Keep track of already deleted comments, so that the script can be restarted.
- Proper Exception handling, for example if there are too many requests.