Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paramt/trackarma
A python script that tracks reddit karma
https://github.com/paramt/trackarma
karma praw python reddit reddit-karma
Last synced: about 1 month ago
JSON representation
A python script that tracks reddit karma
- Host: GitHub
- URL: https://github.com/paramt/trackarma
- Owner: paramt
- License: mit
- Created: 2019-03-24T14:36:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-30T10:28:49.000Z (over 3 years ago)
- Last Synced: 2023-03-02T21:16:04.239Z (almost 2 years ago)
- Topics: karma, praw, python, reddit, reddit-karma
- Language: Python
- Homepage: https://www.param.me/trackarma
- Size: 86.9 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Trackarma
[![Build](https://img.shields.io/travis/paramt/trackarma/master.svg?style=for-the-badge)](https://travis-ci.org/paramt/trackarma)
[![CodeFactor](https://www.codefactor.io/repository/github/paramt/trackarma/badge/?style=for-the-badge)](https://www.codefactor.io/repository/github/paramt/trackarma)A simple python script that uses [PRAW](https://praw.readthedocs.io/en/latest/)
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](https://www.reddit.com/user/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](http://api.param.me/trackarma/charts/transparent/nogrid.png)
## 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](https://www.reddit.com/prefs/apps/)
* 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
```ini
[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](https://www.howtogeek.com/101288/how-to-schedule-tasks-on-linux-an-introduction-to-crontab-files/) on Linux or [Task Scheduler](http://theautomatic.net/2017/10/03/running-python-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](LICENSE). You are free to use, modify, and distribute the source code as long as you include the original license file.