https://github.com/rickstaa/get-stargazers-info
Contains some scripts that can be used to get information about the stargazers of a GitHub repository.
https://github.com/rickstaa/get-stargazers-info
Last synced: about 1 month ago
JSON representation
Contains some scripts that can be used to get information about the stargazers of a GitHub repository.
- Host: GitHub
- URL: https://github.com/rickstaa/get-stargazers-info
- Owner: rickstaa
- Created: 2023-06-18T19:57:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-21T09:08:01.000Z (about 3 years ago)
- Last Synced: 2025-03-04T03:24:23.151Z (over 1 year ago)
- Language: JavaScript
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Get Stargazer Info
Contains scripts that can be used to get information about the stargazers of a GitHub repository.
## How to use
1. Install the npm dependencies with `npm install`.
2. Create a `.env` file with the following content:
```env
GITHUB_TOKEN=YOUR_GITHUB_TOKEN
REPO=REPOSITORY_NAME
OWNER=REPOSITORY_OWNER
LOG_FREQUENCY=50
SAVE_FREQUENCY=100
MAIN_INFO=true
TOTAL_COMMITS=false
USE_GRAPHQL=false # Only use for the 'get-stargazers' script. Slower but doesn't have a 40 pages limit.
LOAD=false # Whether to continue from the last saved point or start from scratch. Only use for the 'get-stargazers' script.
REMOVE_ZERO_VALUES=false # Only used for the `calculate-stargazers-info-stats` script.
REMOVE_ZERO_USERS=false # Only used for the `calculate-stargazers-info-stats` script.
```
1. Run the `get-stargazers.js` script with `npm run get-stargazers` to get the stargazers of the repository.
2. Run the `get-stargazer-info.js` script with `npm run get-stargazer-info` to get the information about the stargazers.
Data is stored in the `data` folder. The `get-stargazers.js` script will create a `--stargazers.json` file with the stargazers of the repository. The `get-stargazer-info.js` script will create a `--stargazer-info.json` file with the information about the stargazers.
> [!WARNING]\
> This script uses the [@octokit/plugin-throttling](https://www.npmjs.com/package/@octokit/plugin-throttling) to avoid hitting the [GitHub API rate limit](https://docs.github.com/en/graphql/overview/resource-limitations). This is done by waiting for the time specified in the `retry-after` header. This means that if the source of interest has many stargazers, it will take a long time to get all the data.