This repository contains an automated scraper that fetches Persian calendar holidays for multiple years and stores them in JSON format.
- Automatically fetches Persian (Solar Hijri) holidays every year.
- Uses Puppeteer to scrape data from reliable sources.
- Stores holidays in a structured JSON format.
- GitHub Actions runs the scraper yearly and updates the repository.
- GitHub Actions triggers the scraper at the start of each Persian year.
- Puppeteer fetches holiday data and stores it in the
holidays/
directory. - JSON files are committed and pushed automatically.
π¦ shamsi-holidays
β£ π holidays
β β£ π 1403.json
β β£ π 1404.json
β β£ π 1405.json
β β π ...
β£ π index.js
β£ π .github/workflows/scraper.yml
β π README.md
## π Setup & Usage
### **Run Locally**
1. Clone the repository:
```sh
git clone https://github.com/hasan-ahani/shamsi-holidays.git
cd shamsi-holidays
-
Install dependencies:
npm install
-
Run the scraper for a specific year:
node index.js 1403
- The scraper runs automatically every year using GitHub Actions.
- You can also trigger it manually by running:
gh workflow run scraper.yml
You can directly access the JSON data for each year using GitHub's raw content link.
For example, to get holidays for the year 1403, use:
https://raw.githubusercontent.com/hasan-ahani/shamsi-holidays/main/holidays/1403.json
Simply replace 1403.json
with any other Persian year to get the holidays for that year.
fetch("https://raw.githubusercontent.com/hasan-ahani/shamsi-holidays/main/holidays/1403.json")
.then(response => response.json())
.then(data => console.log(data));
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Make your changes and commit:
git commit -m "Add a new feature"
- Push the branch:
git push origin feature-branch
- Open a Pull Request.
This project is licensed under the MIT License. Feel free to use and modify.