- Notifications
You must be signed in to change notification settings - Fork133
Remove your comment history on Reddit as deleting an account does not do so.
License
x89/Shreddit
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Shreddit is a Python command line program which will take a user's post history on the websiteReddit, and will systematically go through the user's history deleting one post/submission at atime until only those whitelisted remain. It allows you to maintain your normal reddit account while having your historyscrubbed after a certain amount of time.
When it became known that post edits werenot saved but post deletionswere saved, code was added to edit your postprior to deletion. In fact you can actually turn off deletion all together and just have lorem ipsum (or a messageabout Shreddit) but this will increase how long it takes the script to run as it will be going over all of your messagesevery run.
Due to deprecation of the PRAW 3.x library, Shreddit is using PRAW 4. This requires that OAuth be used to authenticate.Thankfully, however, it is much easier than in previous versions. If you are upgrading,please review the usage sectionto ensure that you have set up credentials correctly.
pip install -U shreddit
will install the package and its dependencies, and it will add ashreddit
command lineutility to your PATH. This is typically either run in a virtualenv or using administrative privileges for globalinstallation.
- Clone the
shreddit
repository to a directory. - From the directory, run
pip install -r requirements.txt
- Run
python setup.py install
to install the package and theshreddit
command line utility. This is typicallyeither run in a virtualenv or using administrative privileges for global installation.
After installing theshreddit
command line utility, the first step is setting up the tool's configuration files.Simply typingshreddit -g
will generate configs. After configuring credentials, running the tool with theshreddit
command will begin the tool's operation.
Runningshreddit -g
will generate a blank praw.ini file that looks like this:
# Credentials go here. Fill out default, or provide one or more names and call shreddit with the -u option to specify# which set to use.[default]client_id=client_secret=username=password=
You must provide values for each of these. As strange as it may seem to provide both a username/password pairanda client id/secret pair, that is how the Reddit API does "OAuth" script applications.
Username and password are simply your Reddit login credentials for the account that will be used. However, to obtain theclient ID and secret, follow these steps (taken fromPRAW documentation):
- Open your Reddit application preferences by clickinghere.
- Add a new application. It doesn't matter what it's named, but calling it "shreddit" makes it easier to remember.
- Select "script".
- Redirect URL does not matter for script applications, so enter something likehttp://127.0.0.1:8080
- Once created, you should see the name of your application followed by 14 character string. Enter this 14 characterstring as your
client_id
. - Copy the 27 character "secret" string into the
client_secret
field.
Finally, your praw.ini should look like this (with fake data provided here):
[default]client_id=f3FaKeD4t40PsJclient_secret=dfK3pfMoReFAkEDaTa123456789username=testuserpassword=123passwordgoeshere123
Keep your praw.ini either in the current directory when runningshreddit
, or in one of the config foldersdescribed here such as~/.config
in Linux or%APPDATA%
in Windows.
To use more than one account, you can add multiple profiles instead of just[default]
and use the-u
option toshreddit
to choose which one each time.
The easiest way to automate this tool after the first run is by using the cron utility. Runcrontab -e
to edit youruser's crontab settings.
Examples:
The following examples require that the PRAW configuration file is located in the config directory. Seethis PRAWdocumentation for more information.
Run every hour on the hour
0 * * * * shreddit -c <full path to shreddit.yml>
Run at 3am every morning
0 3 * * * shreddit -c <full path to shreddit.yml>
Run once a month on the 1st of the month
0 0 1 * * shreddit -c <full path to shreddit.yml>
If virtualenv was used, be sure to addsource /full/path/to/venv/bin/activate &&
before the command. For example:
0 * * * * source /full/path/to/venv/bin/activate && shreddit -c <full path to shreddit.yml>
$ shreddit --helpusage: app.py [-h] [-c CONFIG] [-g] [-u USER]Command-line frontend to the shreddit library.optional arguments: -h, --help show this help message and exit -c CONFIG, --config CONFIG Config file to use instead of the default shreddit.yml -g, --generate-configs Write shreddit and praw config files to current directory. -u USER, --user USER User section from praw.ini if not default
- Make sure you have Python installed.Click here for the Python download page.-Note: Install either
python 2.x
orpython 3.x
, not both. - Follow thepip installation instructions.
- Open a new command prompt and verify that the
shreddit
command works before moving on to theusagesection.
Certain limitations in the Reddit API and the PRAW library make it difficult to delete more than 1,000 comments.While deleting >1000 comments is planned, it is necessary right now to rerun the program until they are all deleted.
We are relying on Reddit admin words that they do not store edits, deleted posts are still stored in the databasethey are merely inaccessible to the public.
A few people have asked about donating so here's a Bitcoin address, any amount is appreciated, spread amongst recentcontributors and if there's enough interest a web service may be on the horizon!1PbeYK7FonjVmgWxf4ieKmvwtomZR1K1Qu