https://github.com/x89/Shreddit Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. {{ message }} x89 / Shreddit Public * Notifications * Fork 130 * Star 883 Remove your comment history on Reddit as deleting an account does not do so. License View license 883 stars 130 forks Star Notifications * Code * Issues 45 * Pull requests 12 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights x89/Shreddit This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 13 branches 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/x] Use Git or checkout with SVN using the web URL. [gh repo clone x89/Sh] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @x89 x89 Fixes #90 ... 2 f4a5b67 Aug 21, 2017 Fixes #90 f4a5b67 2 Git stats * 375 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time shreddit Protect clear_vote when trial_run is in effect July 9, 2017 16:21 .gitignore Makes it easier for users to get the default config November 28, 2016 16:17 LICENSE Updates license information to be more standardized December 7, 2016 02:00 MANIFEST.in Adds a MANIFEST file with README and LICENSE December 13, 2016 13:14 README.md Add donation section May 19, 2017 12:14 praw.ini.example Moves credentials to praw.ini December 6, 2016 01:03 requirements.txt Fixes #90 August 21, 2017 13:41 setup.cfg Gets package ready for PyPI November 28, 2016 17:30 setup.py Bumps minor version for PyPI February 9, 2017 21:49 shreddit.yml.example Removes edit only from configs December 6, 2016 02:56 View code [ ] Shreddit Important New Changes (as of Dec 2016) Pip Installation Manual Installation Usage Configuring Credentials Automating Command Line Options For Windows users Caveats Donate README.md Shreddit Shreddit is a Python command line program which will take a user's post history on the website Reddit, and will systematically go through the user's history deleting one post/submission at a time until only those whitelisted remain. It allows you to maintain your normal reddit account while having your history scrubbed after a certain amount of time. When it became known that post edits were not saved but post deletions were saved, code was added to edit your post prior to deletion. In fact you can actually turn off deletion all together and just have lorem ipsum (or a message about Shreddit) but this will increase how long it takes the script to run as it will be going over all of your messages every run. Important New Changes (as of Dec 2016) 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 section to ensure that you have set up credentials correctly. Pip Installation pip install -U shreddit will install the package and its dependencies, and it will add a shreddit command line utility to your PATH. This is typically either run in a virtualenv or using administrative privileges for global installation. Manual Installation 1. Clone the shreddit repository to a directory. 2. From the directory, run pip install -r requirements.txt 3. Run python setup.py install to install the package and the shreddit command line utility. This is typically either run in a virtualenv or using administrative privileges for global installation. Usage After installing the shreddit command line utility, the first step is setting up the tool's configuration files. Simply typing shreddit -g will generate configs. After configuring credentials, running the tool with the shreddit command will begin the tool's operation. Configuring Credentials Running shreddit -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 pair and a 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 the client ID and secret, follow these steps (taken from PRAW documentation): 1. Open your Reddit application preferences by clicking here. 2. Add a new application. It doesn't matter what it's named, but calling it "shreddit" makes it easier to remember. 3. Select "script". 4. Redirect URL does not matter for script applications, so enter something like http://127.0.0.1:8080 5. Once created, you should see the name of your application followed by 14 character string. Enter this 14 character string as your client_id. 6. 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=f3FaKeD4t40PsJ client_secret=dfK3pfMoReFAkEDaTa123456789 username=testuser password=123passwordgoeshere123 Keep your praw.ini either in the current directory when running shreddit, or in one of the config folders described 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 to shreddit to choose which one each time. Automating The easiest way to automate this tool after the first run is by using the cron utility. Run crontab -e to edit your user's crontab settings. Examples: The following examples require that the PRAW configuration file is located in the config directory. See this PRAW documentation for more information. * Run every hour on the hour 0 * * * * shreddit -c * Run at 3am every morning 0 3 * * * shreddit -c * Run once a month on the 1st of the month 0 0 1 * * shreddit -c If virtualenv was used, be sure to add source /full/path/to/venv/bin/ activate && before the command. For example: 0 * * * * source /full/path/to/venv/bin/activate && shreddit -c Command Line Options $ shreddit --help usage: 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 For Windows users 1. Make sure you have Python installed. Click here for the Python download page. - Note: Install either python 2.x or python 3.x, not both. 2. Follow the pip installation instructions. 3. Open a new command prompt and verify that the shreddit command works before moving on to the usage section. Caveats * 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 database they are merely inaccessible to the public. Donate A few people have asked about donating so here's a Bitcoin address, any amount is appreciated, spread amongst recent contributors and if there's enough interest a web service may be on the horizon! 1PbeYK7FonjVmgWxf4ieKmvwtomZR1K1Qu About Remove your comment history on Reddit as deleting an account does not do so. Topics python oauth privacy reddit reddit-api praw reddit-application privacy-protection privacy-tools Resources Readme License View license Stars 883 stars Watchers 19 watching Forks 130 forks Report repository Releases No releases published Packages 0 No packages published Used by 17 * @millerhooks * @CSeb96 * @disser * @mechanical-girl * @arnavs * @mitchbradford * @TaciturnTexan * @sawyersteven + 9 Contributors 18 * * * * * * * * * * * + 7 contributors Languages * Python 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.