Personal project for monitoring electricity shutdown schedules in Fastiv, Ukraine.
This project is for personal use only. All data is sourced from publicly available information.
- Educational/personal use only
- Respects reasonable request intervals (every 5 minutes)
- Does not store copyrighted HTML content
Automatically scrapes power outage schedule data every 30 minutes using GitHub Actions and publishes the extracted JSON to both GitHub Pages and Cloudflare Pages.
- GitHub Action runs every 30 minutes (or "manually" via external cronjob)
- Playwright loads the page like a real browser
- Extracts schedule data from dynamic responses when available, with a safe fallback strategy
- Saves only JSON outputs (no HTML stored)
- Deploys to GitHub Pages and Cloudflare Pages for easy API access
- Optional: Notifies a webhook endpoint when scraping succeeds
To keep GitHub Actions readable/maintainable, small Node utilities live in scripts/ and are used by the workflow:
scripts/extract-update-from-stdin.js: reads JSON from stdin and prints theupdatestamp (or another field)scripts/extract-update-from-file.js: reads a JSON file and prints theupdatestamp (or another field)scripts/print-scrape-summary.js: prints a short, non-sensitive scrape summaryscripts/verify-pages-updated.sh: waits until the hosting provider serves the newschedule.jsonscripts/resolve-playwright-version.sh: resolves the Playwright version for caching/installsscripts/read-deployed-update-stamp.sh: reads the deployedschedule.jsonupdate stamp
Latest schedule data available at:
- Cloudflare Pages JSON API:
https://<project>.pages.dev/schedule.json - Cloudflare Pages Metadata:
https://<project>.pages.dev/latest-metadata.json - GitHub Pages JSON API:
https://ivanvasechko.github.io/scrap-shutdowns/schedule.json - GitHub Pages Metadata:
https://ivanvasechko.github.io/scrap-shutdowns/latest-metadata.json
Metadata is intentionally redacted and does not include any information about where the data was parsed from.
- Node.js + Playwright (headless browser)
- GitHub Actions (free tier - unlimited for public repos)
- GitHub Pages + Cloudflare Pages (free hosting)
Set these secrets in your GitHub repository (Settings → Secrets and variables → Actions):
TARGET_URL: The URL to scrapeDATA_VARIABLE_NAME: JavaScript variable name containing the data
CLOUDFLARE_API_TOKEN: Cloudflare API token with Pages deploy permissionsCLOUDFLARE_ACCOUNT_ID: Cloudflare account idCLOUDFLARE_PAGES_PROJECT: Cloudflare Pages project name- (optional)
CLOUDFLARE_PAGES_URL: base URL to verify against (e.g.https://your-domain.example/)- If omitted, the workflow assumes
https://<project>.pages.dev/.
- If omitted, the workflow assumes
- Cloudflare Dashboard → Workers & Pages → Create application.
- Choose Pages.
- Create a project (any simple placeholder settings are fine; the GitHub workflow deploys via API).
- Copy the Account ID from the dashboard.
- Cloudflare Dashboard → My Profile → API Tokens → create a token that can deploy to Pages.
- Add the GitHub secrets listed above.
- Run Actions → Scrape Shutdowns Information → Run workflow.
The workflow deploys the contents of scraped-data/ and publishes _headers so schedule.json and latest-metadata.json are served with Cache-Control: no-store.
WEBHOOK_URL: URL to ping when scraping succeedsWEBHOOK_AUTH_TOKEN: Authorization token for the webhook endpoint (include the scheme prefix if needed, e.g., "Bearer YOUR_TOKEN")
The webhook receives:
X-Updated-Schedule-URLheader: The preferred hosting URL (prioritizes Cloudflare Pages over GitHub Pages)X-Updated-Schedule-URLsheader: Space-separated list of all successfully updated hosting URLs
{
"data": {
"1763676000": {
"GPV1.1": {
"1": "yes",
"2": "yes",
...
}
}
},
"update": "21.11.2025 15:45",
"today": 1763676000,
"scraped_at": "2025-11-21T14:42:55.354Z"
}Personal use only. Data copyright belongs to respective owners.
This is a personal project. If you want to use it, please fork and respect the source website's terms of service.