https://github.com/developersindia/metrics
📈 developersIndia community metrics/stats API
https://github.com/developersindia/metrics
api developersindia praw-reddit python3 static-api subreddit-analytics subreddit-metrics subreddit-stats
Last synced: 7 months ago
JSON representation
📈 developersIndia community metrics/stats API
- Host: GitHub
- URL: https://github.com/developersindia/metrics
- Owner: developersIndia
- License: mit
- Created: 2022-09-05T18:05:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-17T15:39:52.000Z (about 1 year ago)
- Last Synced: 2024-11-17T16:37:37.306Z (about 1 year ago)
- Topics: api, developersindia, praw-reddit, python3, static-api, subreddit-analytics, subreddit-metrics, subreddit-stats
- Language: Python
- Homepage: https://developersindia.github.io/metrics/data/
- Size: 257 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# metrics 📈
[](#contributors-)
[](https://discordapp.com/invite/MKXMSNC)
[](https://www.reddit.com/r/developersIndia/)
> Generate developersIndia Community Stats from Subreddit
Currently the stats are generated in following JSON format:
```json
{
"totalMembers": 66600,
"lastMonthUniquePageViews": 79519,
"lastMonthTotalPageViews": 1286500,
"yesterdayUniquePageViews": 18929,
"yesterdayTotalPageViews": 71916,
"discordTotalMembers": 7269,
"discordTotalActiveMembers": 633
}
```
## Setup 👷
1. Clone the repo
```bash
git clone https://github.com/developersIndia/metrics.git
```
2. Initialise a virtual environment.
```bash
cd metrics
python3 -m venv venv
source venv/bin/activate
```
3. Install dependencies
```bash
pip install -r requirements.txt
```
4. Export environment variables.
* Reddit(Make sure you are have moderator privileges for the subreddit you want stats for).
```
export REDDIT_CLIENT_ID=
export REDDIT_CLIENT_SECRET=
export REDDIT_PASSWORD=
export REDDIT_USER=
```
* Discord(If possible set expiry to never)
```
export DISCORD_INVITE_CODE=
```
## Testing
Run the following command to run the test suite:
```bash
python -m unittest
```
## Resources & Learning Material 📚
- [PRAW Docs](https://praw.readthedocs.io/en/latest/code_overview/models/subreddit.html#praw.models.Subreddit.traffic)
# 📜 License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!