Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
forked fromx89/Shreddit

My own maintained fork of x89's Reddit post/comment mass deletion program, which they stopped updating.

License

NotificationsYou must be signed in to change notification settings

ksurl/Shreddit

 
 

Repository files navigation

Original repo and Readme.mdhere.

No longer updated as of 1/7/22. Please seethis, for a list of alternatives.

FAQ - Common Error(s)

  1. <something> installed but version <something> is required. - Upgrade 'setuptools' withpip install --upgrade setuptools
  2. Command "python setup.py egg_info" failed with error code 1 - You are missing a dependency. Try installing using manual instructions below.
  3. Invalid requirement: '<<<<<<< HEAD' Traceback (most recent call last): et cetera, et cetera1 - You are trying to install the original repo's broken code. Clone and install mine with the fixes.

Pre-install conditions:

Make sure you install pip

$ apt install python3-pip

Then update pip with

$ python3 -m pip install --upgrade pip

Note: Python2 is now depreciated. Use python3.

Manual Installation

  1. Clone theshreddit repository to a directory:$ git clone https://github.com/pythonInRelay/Shreddit.git
  2. From the directory, run$ pip3 install -r requirements.txt
  3. Run$ python3 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 (so you can run theshreddit command from anywhere).

Post-install steps

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 your user credentials and deletion scope (in the created praw.ini), running the tool with theshredditcommand will begin the tool's operation. Sit back and wait for it to parse each comment.

Configuring Credentials

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=ratelimit_seconds=31 ## HIGHLY RECOMMENDED as Reddit now limits API calls

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):

  1. Open your Reddit application preferences by clickinghere.
  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 likehttp://127.0.0.1:8080
  5. Once created, you should see the name of your application followed by 14 character string. Enter this 14 characterstring as yourclient_id.
  6. Copy the 27 character "secret" string into theclient_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.

Automating

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 hour0 * * * * shreddit -c <full path to shreddit.yml>

  • Run at 3am every morning0 3 * * * shreddit -c <full path to shreddit.yml>

  • Run once a month on the 1st of the month0 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>

Command Line Options

$ 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

For Windows users

  1. Get Linux.No really...

  2. Make sure you have Python installed.Click here for the Python download page.-Note: Installpython 3.x, not2.x.

  3. Follow thepip installation instructions.

  4. Open a new command prompt and verify that theshreddit command works before moving on to theusagesection.

About

My own maintained fork of x89's Reddit post/comment mass deletion program, which they stopped updating.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python98.6%
  • Dockerfile1.4%

[8]ページ先頭

©2009-2025 Movatter.jp