Skip to content

πŸ“… Persian Calendar Holidays Scraper – A GitHub Action that automatically scrapes official public holidays from Time.ir and saves them as structured JSON files. Supports future years and updates monthly!

Notifications You must be signed in to change notification settings

hasan-ahani/shamsi-holidays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“† Persian Calendar Holidays Scraper

This repository contains an automated scraper that fetches Persian calendar holidays for multiple years and stores them in JSON format.

πŸš€ Features

  • 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.

πŸ“œ How It Works

  1. GitHub Actions triggers the scraper at the start of each Persian year.
  2. Puppeteer fetches holiday data and stores it in the holidays/ directory.
  3. JSON files are committed and pushed automatically.

πŸ“‚ Folder Structure

πŸ“¦ 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
  1. Install dependencies:

    npm install
  2. Run the scraper for a specific year:

    node index.js 1403

Automated Workflow

  • The scraper runs automatically every year using GitHub Actions.
  • You can also trigger it manually by running:
    gh workflow run scraper.yml

🌐 Access JSON Data (Raw URL)

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.

Usage Example (Fetching JSON with JavaScript)

fetch("https://raw.githubusercontent.com/hasan-ahani/shamsi-holidays/main/holidays/1403.json")
  .then(response => response.json())
  .then(data => console.log(data));

🀝 Contributing

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-branch
  3. Make your changes and commit:
    git commit -m "Add a new feature"
  4. Push the branch:
    git push origin feature-branch
  5. Open a Pull Request.

πŸ“œ License

This project is licensed under the MIT License. Feel free to use and modify.

About

πŸ“… Persian Calendar Holidays Scraper – A GitHub Action that automatically scrapes official public holidays from Time.ir and saves them as structured JSON files. Supports future years and updates monthly!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published