Creates charts based on the trends of certain comment phrases within a Reddit thread.
Inspired by this Reddit post, I've finally gotten around to designing a program to easily replicate the results shown.
My program (Running
python dl_process_comments.py -t 8y1m08 -p fuck -n 4):
Another example from the 2019 Canadian Grand Prix:
The uses of the word 'penalty' spiked due to a controversial FIA call that caused Hamilton to win the race despite Vettel finishing first.
You must have PRAW installed to run this program. Install it using
pip install praw.
praw.ini file with the following format:
[phrasetrend] username=YOUR_REDDIT_USERNAME password=YOUR_REDDIT_PASSWORD client_id=YOUR_REDDIT_CLIENT_ID client_secret=YOUR_REDDIT_CLIENT_SECRET
Running the Program
python dl_process_comments.py -t THREAD_ID -p PHRASE -n NUM_HOURS_TO_COLLECT. The program will output a
all_comments.csv file, each containing two columns:
- The Unix timestamp of each comment containing the phrase
- The corresponding Reddit comment ID
These files are used in R to create a plot of the data in the CSV file. Do this by running
This project is licensed under the MIT License - see the LICENSE file for details.