GitXplorerGitXplorer
b

mood-reddit

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
5a0c6d305aae1d0096c4ea1bfa1448c33038e52e

Update README.md

bboyleconnor committed a year ago
Verified
376c8e280f6fd8a27e57dfd8ff064cc7c4f7f28c

Update README.md

bboyleconnor committed a year ago
Unverified
8643e24672c5f91c29096680ec6cdbc332447dec

Fix bug from typo

bboyleconnor committed a year ago
Unverified
e32c600bdb1200f418e7cf9852ba53fada8a18f5

Check comments and posts for mentions

bboyleconnor committed a year ago
Unverified
9b4c318d3ed2e4f1848484ecc82b22d5b29cb99b

Make the scrape script recoverable; load recent posts from saved file

bboyleconnor committed a year ago
Unverified
e24e70290374168d73c9b3ba6fa3c05a989751e5

Set hard-coded user agent

bboyleconnor committed a year ago

README

The README file for this repository.

Mood-Reddit

Set up

You'll need to create a Reddit API "app" and get its credentials in order to run these scripts. While logged into the Reddit account that you want to associate with this app, go to the "apps" prefs page and create "script"-type app. Then copy the app ID from under the app name and the app secret. Do not share any of these publicly in any form.

In order to make these credentials accessible to the scripts in this repo, you will have to provide them as environment variables or create a dotenv file. To use the dotenv file option, create a file in this repo directory named .env and fill it with the following content:

CLIENT_ID="XXXXXXXXXXXXXXXXXXXXXX"
CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
USER_AGENT="ubuntu:com.example.mood_mentions_scraper:v0.0.0 (by u/Reddit-Username-Here)"

replacing "xxxxx" with the appropriate values (keep the quotation marks). Also, you should replace "ubuntu" with the name of operating system you are running on and "Reddit-Username-Here" with the Reddit username responsible for authoring this script.

Run

  • scrape.py downloads the ~1,000 most recent posts from selected subreddits (saving them with pickle)
  • check_mentions.py scans those pickled downloads for mentions of keywords "mood", "hello mood", etc.