https://github.com/encoreshao/github-trending
GitHub Weekly Trending Repositories
https://github.com/encoreshao/github-trending
github trending-repositories
Last synced: 10 months ago
JSON representation
GitHub Weekly Trending Repositories
- Host: GitHub
- URL: https://github.com/encoreshao/github-trending
- Owner: encoreshao
- Created: 2024-07-22T12:54:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-11T04:20:06.000Z (10 months ago)
- Last Synced: 2025-04-11T05:27:26.232Z (10 months ago)
- Topics: github, trending-repositories
- Language: Jupyter Notebook
- Homepage:
- Size: 1.98 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub - Weekly Trending Repositories (2024 Active)
This project is a Node.js script that fetches the top 20 trending GitHub repositories created in the last week, and saves the data into a markdown file.
The markdown file is saved in the `docs` directory with the current date as the filename.
The script is set up to run daily as a cron job, automatically generating the markdown file, committing the changes to a Git repository, and pushing the updates.
## Features
- Fetches top 20 trending GitHub repositories created in the last week.
- Saves repository data into a markdown file in the `docs` directory.
- Each markdown file includes repository details such as name, stars, owner, avatar, description, topics, URLs, and other relevant details.
- Automatically runs daily via a cron job, commits the changes, and pushes to a Git repository.
## Prerequisites
- Node.js
- npm (Node Package Manager)
- Git
- A GitHub Personal Access Token with `repo` and `read:user` scopes.
## Setup
1. **Clone the repository:**
```sh
git clone https://github.com/encoreshao/github-trending.git
cd github-trending
```
2. **Install dependencies:**
```sh
npm install
```
3. **Set up environment variables:**
Create a `.env` file in the root directory of the project and add your GitHub Personal Access Token:
```env
GITHUB_TOKEN=your_github_token
```
## Usage
1. **Run the script manually:**
You can run the script manually to fetch the trending repositories and save the data into a markdown file:
```sh
node index.js
```
2. **Set up the cron job:**
To automate the process, set up a cron job to run the script daily. Edit your crontab file:
```sh
crontab -e
```
Add the following line to run the script every day at midnight:
```sh
0 0 * * * /path/to/your/project/scripts/run.sh
```
Replace `/path/to/your/project/scripts/run.sh` with the actual path to your `run.sh` script.
## License
Github-Trending is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).