Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-17T15:39:52.000Z (about 1 month ago)
- Last Synced: 2024-11-17T16:37:37.306Z (about 1 month 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 📈
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg)](#contributors-)
[![Discord](https://img.shields.io/discord/669880381649977354?color=%237289da&label=Discord&logo=Discord)](https://discordapp.com/invite/MKXMSNC)
[![Subreddit subscribers](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fdevelopersindia.github.io%2Fmetrics%2Fdata%2F&query=%24.totalMembers&suffix=%20members&style=flat&logo=reddit&label=r%2FdevelopersIndia&color=orange&link=https%3A%2F%2Fwww.reddit.com%2Fr%2FdevelopersIndia
)](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=
```
## TestingRun 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!