Skip to content

paramt/trackarma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trackarma

Build CodeFactor

A simple python script that uses PRAW to track Reddit karma. The script logs an account's total karma and dynamically generates a chart with the data it's collected. Below is an example using data collected from /u/GallowBoob – a Redditor who's infamous for his high karma count. The chart is showing data that was collected every minute for over 3 months.

Image

Setup

1. Clone the repo

git clone https://github.com/paramt/trackarma.git

2. Install dependencies

  • pip install praw
  • pip install matplotlib

3. Configure PRAW

  • Create a new app on Reddit
    • Follow this link
    • Click create new app
    • Choose personal use script
    • Add a name and description
    • Click create app and copy the ID and secret
  • Create a file named praw.ini inside the repo
  • Make a new configuration that looks like this
[Bot]
client_id=[YOUR APP ID]
client_secret=[YOUR APP SECRET]
user_agent=Karma Tracker Bot 1.0

4. Configure Trackarma

  • Open constants.py
  • Change the value of reddit_name to the username you're tracking
  • Optionally, you can change other constants there (like the chart's title)

5. Set up a scheduled task

Run sudo python -m src.collect_data at a constant interval using Crontab on Linux or Task Scheduler on Windows. To generate the chart, run sudo python -m src.generate_chart. The live example is running both commands every minute, but you may choose to run them at any interval

Output

The script will output everything in data/

  • chart.png – a line graph displaying the Redditor's karma over time
  • dates.txt– the datetime entries of each time collect_data.py ran
  • karma-total.txt – a record of the Redditor's karma over time
  • karma-delta.txt – a record of the Redditor's karma gain over time

License

This project is licensed under the MIT license. You are free to use, modify, and distribute the source code as long as you include the original license file.

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages