{"id":51382809,"url":"https://github.com/comigor/traffic","last_synced_at":"2026-07-03T17:09:14.501Z","repository":{"id":359438885,"uuid":"1245990299","full_name":"comigor/traffic","owner":"comigor","description":"Live Google Maps traffic ETA kiosk","archived":false,"fork":false,"pushed_at":"2026-05-22T21:33:08.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-24T22:22:39.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/comigor.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-21T19:04:56.000Z","updated_at":"2026-05-22T21:33:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/comigor/traffic","commit_stats":null,"previous_names":["comigor/traffic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/comigor/traffic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comigor%2Ftraffic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comigor%2Ftraffic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comigor%2Ftraffic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comigor%2Ftraffic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/comigor","download_url":"https://codeload.github.com/comigor/traffic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/comigor%2Ftraffic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35094198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-03T02:00:05.635Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-07-03T17:09:13.691Z","updated_at":"2026-07-03T17:09:14.496Z","avatar_url":"https://github.com/comigor.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Live Traffic ETA Kiosk\n\nA single-file, zero-dependency public display kiosk for showing live Google Maps ETAs from a central HQ to a list of places. Designed for wall displays with a dark, transit-board aesthetic.\n\n## How to run locally\n\nNo build step required. Just serve the directory:\n\n```bash\npython3 -m http.server 8000\n```\n\nThen open your browser to:\n`http://localhost:8000/?key=YOUR_GOOGLE_MAPS_API_KEY`\n\n## Configuration\n\nEdit the top of the `\u003cscript\u003e` tag in `index.html` to configure your `HQ` and `PLACES`:\n\n```javascript\nconst HQ = { name: 'HQ', address: '...' };\nconst PLACES = [\n  { name: 'Airport',    icon: 'plane',  address: '...', dir: 'both',    mode: 'driving' },\n  { name: \"Fabricio's\", icon: 'home',   address: '...', dir: 'both',    mode: 'transit' },\n  // ...\n];\n```\n\n### Place fields\n\n| Field | Required | Values | Notes |\n|---|---|---|---|\n| `name` | yes | any string | Displayed as the card title |\n| `icon` | yes | `plane` `park` `soccer` `subway` `home` | Inline SVG; see below to add more |\n| `address` | yes | any string | Passed directly to the Routes API |\n| `dir` | yes | `'from-hq'` `'to-hq'` `'both'` | Which directions to request and display |\n| `mode` | yes | `'driving'` `'transit'` | Travel mode. Driving uses `computeRouteMatrix` (batched, Advanced SKU). Transit uses `computeRoutes` per pair (Essentials SKU, 10k/month free tier) to extract the transit line name and walking time. Each transit place adds ~2 calls per refresh. Transit rows show a line-name chip (colored if the API returns a line color) and walking time in the sub-label. |\n\n### Adding a new icon\n\n1. Find or create a 24x24 SVG path (Material Symbols or similar).\n2. Add a `\u003csymbol id=\"icon-NAME\" viewBox=\"0 0 24 24\"\u003e\u003cpath d=\"...\"/\u003e\u003c/symbol\u003e` entry inside the `\u003csvg\u003e\u003cdefs\u003e` sprite block near the top of `\u003cbody\u003e` in `index.html`.\n3. Reference it with `icon: 'NAME'` in the `PLACES` entry.\n\n## Refresh schedule\n\nThe kiosk uses a time-window schedule in **BRT (America/Sao_Paulo)**. Windows and intervals are hardcoded in the `SCHEDULE` constant near the top of `index.html` and are easy to edit.\n\n| Window | Hours (BRT) | Interval |\n|---|---|---|\n| Peak | 08:00 – 09:30 | `?refresh=` param (default 10 min) |\n| Peak | 11:30 – 13:00 | `?refresh=` param (default 10 min) |\n| Peak | 18:30 – 21:00 | `?refresh=` param (default 10 min) |\n| Off-peak | all other hours within 06:00 – 22:00 | 60 min (hardcoded) |\n| Sleep | 22:00 – 06:00 | no API calls |\n\nDuring the sleep window the kiosk shows the last known data and displays \"PAUSED / Resumes 06:00 BRT\" in the top bar.\n\n## URL Parameters\n\n*   `key` (Required): Your Google Maps API Key.\n*   `refresh`: Peak-window refresh interval in minutes (default `10`, clamped 1–30). Has no effect on the off-peak 60-minute cadence or the sleep window.\n*   `units`: Set to `imperial` or `metric`. Default is `metric`.\n\nExample:\n`/?key=AIza...\u0026refresh=5\u0026units=imperial`\n\n## Google Maps API Key Setup\n\n1. Go to the [Google Cloud Console](https://console.cloud.google.com/).\n2. Enable the **Maps JavaScript API** and the **Routes API**.\n3. Generate an API Key.\n4. **Important**: Restrict your API key to prevent unauthorized use. Under \"Application restrictions\", choose \"HTTP referrers\" and add your GitHub Pages domain (e.g., `https://yourusername.github.io/traffic/*`).\n\n## Estimated API cost\n\nEach refresh fires parallel calls. With the current 8-place list (7 driving + 1 transit, all `dir: \"both\"`):\n\n**Driving** (`computeRouteMatrix`, Advanced SKU — $10/1000 elements):\n- 2 calls: 1×7 elements (HQ → driving) + 7×1 elements (driving → HQ) = 14 elements/refresh\n\n**Transit** (`computeRoutes`, Essentials SKU — $5/1000 calls, 10k/month free):\n- 2 calls: 1 call each direction per transit place = 2 calls/refresh\n\nAt stated rates:\n\n- **Peak** (~4.5 h/day, 10-min interval, ~27 refreshes): 378 driving elements + 54 transit calls/day\n- **Off-peak** (~11.5 h/day, 60-min interval, ~11 refreshes): 154 driving elements + 22 transit calls/day\n- **Sleep**: 0\n\n**Total: ~532 driving elements/day ≈ $0.0053/day + ~76 transit calls/day well within free tier. (~$1.94/year for driving alone.)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomigor%2Ftraffic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomigor%2Ftraffic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomigor%2Ftraffic/lists"}