{"id":28230885,"url":"https://github.com/iamdulanga/iqair-data-scraper","last_synced_at":"2026-01-26T17:05:00.254Z","repository":{"id":276077154,"uuid":"928136933","full_name":"iamdulanga/iqair-data-scraper","owner":"iamdulanga","description":"Air quality data scraping tool for get real-time data from https://www.iqair.com/ in Sri Lanka by FECTSL","archived":true,"fork":false,"pushed_at":"2025-06-15T09:24:46.000Z","size":55373,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T06:52:48.295Z","etag":null,"topics":["air-quality","air-quality-data","data-scraper","iqair","purple-air"],"latest_commit_sha":null,"homepage":"https://iqair-data-scraper.onrender.com/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iamdulanga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["iamdulanga"],"buy_me_a_coffee":"iamdulanga"}},"created_at":"2025-02-06T05:53:41.000Z","updated_at":"2025-09-02T03:32:30.000Z","dependencies_parsed_at":"2025-02-06T06:31:41.286Z","dependency_job_id":"bb92e1ac-563e-4f37-8626-2f415f02c67b","html_url":"https://github.com/iamdulanga/iqair-data-scraper","commit_stats":null,"previous_names":["dulangadasanayake/iqair-data-scraper","iamdulanga/iqair-data-scraper"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iamdulanga/iqair-data-scraper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamdulanga%2Fiqair-data-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamdulanga%2Fiqair-data-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamdulanga%2Fiqair-data-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamdulanga%2Fiqair-data-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamdulanga","download_url":"https://codeload.github.com/iamdulanga/iqair-data-scraper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamdulanga%2Fiqair-data-scraper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28782644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["air-quality","air-quality-data","data-scraper","iqair","purple-air"],"created_at":"2025-05-18T17:33:42.681Z","updated_at":"2026-01-26T17:05:00.249Z","avatar_url":"https://github.com/iamdulanga.png","language":"HTML","funding_links":["https://github.com/sponsors/iamdulanga","https://buymeacoffee.com/iamdulanga"],"categories":[],"sub_categories":[],"readme":"# AQI File Generation \u0026 Download Web App\n\nThis project has been archived and will not be updated again. to access the latest version visit www.github.com/fectlk/iqair-data-scraper and this is the very original repository of this project.\n\nThis project is a web application that allows users to view and download air quality index (AQI) files (maps and charts) generated from a scheduled task. The files are stored in a GitHub repository and can be downloaded directly from the web interface.\n\n## Features\n- **Automated File Generation**: AQI files for Sri Lanka (charts and maps) are automatically generated and stored in a GitHub repository daily.\n- **File Listing**: The app dynamically fetches and lists files stored in two folders on GitHub: `maps` and `charts`.\n- **File Selection**: Users can select files they wish to download using checkboxes.\n- **File Download**: Users can download selected files directly from the GitHub repository with a single click.\n\n## Folder Structure\n\n- **maps/**: Contains generated map files in HTML format for AQI data visualization.\n- **charts/**: Contains generated chart files in Excel format containing AQI data for all cities and most polluted cities in Sri Lanka.\n\n## Technologies Used\n\n- **Python**: For generating AQI data, maps, and charts.\n- **JavaScript**: For handling client-side interactions (file listing and downloading).\n- **GitHub API**: To list files from the GitHub repository.\n- **Vercel / Netlify**: To host the web app.\n\n## Setup \u0026 Installation\n\n1. **Clone the Repository**\n\n   Clone the repository to your local machine:\n\n   ```bash\n   git clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git\n   cd YOUR_REPO_NAME\n   ```\n\n2. **Setup Python Environment**\n\n   - Install the required Python libraries by running the following command:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n   The dependencies include:\n   - `requests`\n   - `beautifulsoup4`\n   - `pandas`\n   - `folium`\n   - `geopy`\n   - `openpyxl`\n\n3. **Set Up GitHub Actions**\n\n   - The repository includes a GitHub Action defined in `.github/workflows/aqi_generator.yml` that runs daily at 12:00 PM to scrape the latest AQI data and generate the required files (maps and charts).\n   - The generated files are stored in two folders (`maps` and `charts`) in the GitHub repository.\n\n4. **Deploy the Web App**\n\n   - You can deploy the web app to either **Vercel** or **Netlify**. Both services provide an easy way to deploy static sites by connecting your GitHub repository.\n   \n   - **For Vercel**:\n     - Sign up for a Vercel account if you don't have one.\n     - Connect your GitHub repository to Vercel.\n     - Deploy the site by selecting the project from your dashboard.\n\n   - **For Netlify**:\n     - Sign up for a Netlify account.\n     - Connect your GitHub repository to Netlify.\n     - Deploy the site by selecting the project from your dashboard.\n\n5. **Web App Functionality**\n\n   - The web app automatically displays a list of files (charts and maps) stored in your GitHub repository.\n   - Users can view the file names, select the files using checkboxes, and download the selected files by clicking the \"Download Selected Files\" button.\n\n## How It Works\n\n### Automated File Generation (GitHub Actions)\n\n1. **Scheduled Task**: A GitHub Action runs every day at 12:00 PM to fetch the latest AQI data for Sri Lanka from the IQAir website.\n2. **File Creation**:\n   - **Charts**: The AQI data is saved in Excel files with two sheets: \"All Cities\" and \"Most Polluted Cities.\"\n   - **Maps**: A map showing the locations of the most polluted cities in Sri Lanka is generated and saved as an HTML file.\n3. **File Upload**: The generated files are automatically uploaded to the `maps` and `charts` folders in the GitHub repository.\n\n### Web App\n\n1. The **index.html** page loads when accessed.\n2. **Fetching Files**: The app uses the GitHub API to fetch files from the `maps` and `charts` folders in your GitHub repository.\n3. **Displaying Files**: The app displays the files as checkboxes under \"Maps\" and \"Charts\" sections.\n4. **Downloading Files**: Users can select files using the checkboxes and download them directly by clicking the \"Download Selected Files\" button.\n\n### Example of GitHub API File List\n\nThe files in your repository's `maps` and `charts` folders are fetched via the GitHub API. For each file, the `download_url` is used to generate a direct download link.\n\n## GitHub Repository Setup\n\n### GitHub API Permissions\n\nThe app fetches files from the GitHub repository using the GitHub API. To ensure the app has access to the repository, make sure:\n\n- The repository is **public** (or private with appropriate API access tokens configured).\n  \n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n### Notes for Developers\n\n- **Future Enhancements**:\n  - Consider adding features like file preview (for charts), real-time updates, or filtering files by date or name.\n  - You could also extend the GitHub Action to send email notifications once new files are generated.\n  \n- **Security**:\n  - If the repository is private, use GitHub API tokens with restricted access instead of public access.\n\n---\n\n## How the Map Works\n\n- 📍 Cities with highest AQI in each province are marked on Sri Lanka.\n- 🎨 Color-coded AQI levels:\n\n- 🟢 Green (0-50) → Good\n- 🟡 Yellow (51-100) → Moderate\n- 🟠 Orange (101-150) → Unhealthy for Sensitive Groups\n- 🔴 Red (151-200) → Unhealthy\n- 🟣 Purple (201-300) → Very Unhealthy\n- 🟤 Maroon (301+) → Hazardous\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamdulanga%2Fiqair-data-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamdulanga%2Fiqair-data-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamdulanga%2Fiqair-data-scraper/lists"}