Skip to content

reagle/reddit-research

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Tools for scraping and analyzing Reddit and for messaging Redditors. You can download and install with uv tool install reddit-research.

reddit-search

❯ reddit-search -h
usage: reddit-search [-h] [-r] [-c COLUMN] [-L] [-V] [--version] FILE

Facilitate a search of phrases appearing in a spreadsheet column
(default: 'phrase') by generating queries against search engines and
opening the results in browser tabs. Search engines include Google,
Reddit, and RedditSearch/Pushshift.

> reddit-search demo-phrases.csv -c phrase

If you wish to test the efficacy of a disguised/spun phrase, also
include a column of the spun phrase and the 'url' of the source. This
will automatically check the results for that URL.

> reddit-search demo-phrases.csv -c weakspins

positional arguments:
  FILE

options:
  -h, --help           show this help message and exit
  -r, --recheck        recheck non-NULL values in 'found' column
  -c, --column COLUMN  sheet column to query [default: 'phrase']
  -L, --log-to-file    log to file reddit-search.log
  -V, --verbose        increase verbosity from critical though error, warning, info, and debug
  --version            show program's version number and exit

reddit-query

usage: reddit-query [-h] [-a AFTER] [-b BEFORE] [-l LIMIT] [-c COMMENTS_NUM]
                    [-r SUBREDDIT] [--sample] [--skip] [-t] [-L] [-V]
                    [--version]

Query Pushshift and Reddit APIs.

options:
  -h, --help            show this help message and exit
  -a, --after AFTER     submissions after: Y-m-d (any pendulum parsable).
                        Using it without before starts in 1970!
  -b, --before BEFORE   submissions before: Y-m-d (any pendulum parsable).
                        Using it without before starts in 1970!
  -l, --limit LIMIT     limit to (default: 5) results
  -c, --comments_num COMMENTS_NUM
                        number of comments threshold '[<>]\d+]' (default:
                        False). Note: this is updated as Pushshift ingests,
                        `score` is not.
  -r, --subreddit SUBREDDIT
                        subreddit to query (default: AmItheAsshole)
  --sample              sample complete date range up to limit, rather than
                        first submissions within limit
  --skip                skip all Reddit fetches; pushshift only
  -t, --throwaway-only  only throwaway accounts ('throw' and 'away') get
                        fetched from Reddit
  -L, --log-to-file     log to file reddit-query.log
  -V, --verbose         increase verbosity from critical though error,
                        warning, info, and debug
  --version             show program's version number and exit

reddit-watch

usage: reddit-watch [-h] [-i INIT] [--hours HOURS] [-L] [-V] [--version]

Watch the deletion/removal status of Reddit messages. Initialize subreddits to
be watched first (e.g., 'Advice+AmItheAsshole). Schedule using cron or launchd

options:
  -h, --help         show this help message and exit
  -i, --init INIT    INITIALIZE `+` delimited subreddits to watch
  --hours HOURS      previous HOURS to fetch
  -L, --log-to-file  log to file reddit-watch.log
  -V, --verbose      increase verbosity from critical though error, warning,
                     info, and debug
  --version          show program's version number and exit

reddit-message

usage: reddit-message [-h] -i FILENAME [-a FILENAME] [-g FILENAME] [-d] [-e]
                      [-p] [-t] [-r RATE_LIMIT] [-s] [-D] [-L] [-V]
                      [--version]

Message Redditors using CSV files with usernames in column `author_p`. Can
take output of reddit-query or reddit-watch and select users for messaging
based on attributes.

options:
  -h, --help            show this help message and exit
  -i, --input-fn FILENAME
                        CSV filename, with usernames, created by reddit-query
  -a, --archive-fn FILENAME
                        CSV filename of previously messaged users to skip;
                        created if doesn't exist (default: reddit-message-
                        users-past.csv)
  -g, --greeting-fn FILENAME
                        greeting message filename (default: greeting.txt)
  -d, --only-deleted    select deleted users only
  -e, --only-existent   select existent (NOT deleted) users only
  -p, --only-pseudonym  select pseudonyms only (NOT throwaway)
  -t, --only-throwaway  select throwaway accounts only ('throw' and 'away')
  -r, --rate-limit RATE_LIMIT
                        rate-limit in seconds between messages (default: 40)
  -s, --show-csv-users  also show all users from input CSV on terminal
  -D, --dry-run         list greeting and users but don't message
  -L, --log-to-file     log to file reddit-message.log
  -V, --verbose         increase verbosity from critical though error,
                        warning, info, and debug
  --version             show program's version number and exit

About

Tools for scraping and analyzing Reddit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages