This python program computes the Coleman-Liau Index for all the top comments of a reddit thread and generates a report.txt indicating the average Coleman-Liau Index of all top comments, along with, the Coleman-Liau Index of the submission title. The program is able to run on either a single reddit link, multiple reddit links stored in a text file, or finding the top 10 posts of a given subreddit. The program is able to access reddit through the use of PRAW(Python Reddit API Wrapper).
To learn more about the Coleman-Liau Index: https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index
To learn more about PRAW: https://pypi.org/project/praw/
PRAW
json
- Please ensure you are using Python version 3.6.0 or up.
- To install the necessary dependencies, run the following in CMD or terminal:
pip install -r requirements.txt - Please setup praw before running the program through the following link: https://praw.readthedocs.io/en/latest/getting_started/authentication.html#oauth
- Edit the 'credentials.json' file with the necessary information needed by PRAW.
- When running the program, it will prompt from the following 3 options:
A. Checking the Coleman-Liau Index of all top comments from a given reddit link.
B. Checking the Coleman-Liau Index of all top comments through a text file containing reddit links, separated by newline. This file is named 'threads.txt'.
C. Finding the Coleman-Liau Index of all top comments from the top 10 submissions of an existing subreddit. \
- Computes the Coleman-Liau Index for the top comments of any reddit submission.
- Able to read in a text file of reddit links and computing the Coleman-Liau Index of the top comments of each submission.
- Finds the Coleman-Liau Index of top comments from the top 10 submissions of an existing subreddit.
- Generates a report.txt file at the end of the program with the various information. This is generated for each submission:
- Title of submission
- Submission ID
- Number of upvotes
- Total number of comments
- Coleman-Liau Index of the submission title
- Average Coleman-Liau Index of the top comments
- Securely stores client information needed for praw locally, in a json file.
Kevin Gao
Licensed under MIT License