日本語のREADMEはこちらです: README.ja.md
A real-time parking availability viewer for municipal parking lots in Sabae City, Fukui, Japan.
- Displays real-time availability ("満車" - Full / "空車" - Vacant).
- Status is indicated with colored labels: red for "Full" and blue for "Vacant".
- Automatically refreshes data every 60 seconds in the browser.
- Presents information in a transposed table layout for mobile-friendly viewing.
- Built with vanilla JavaScript, requiring no external frameworks.
The core logic can be imported and used in other projects.
import { getParking, updateParking } from "https://code4fukui.github.io/parking-view/parking.js";
// Get initial parking lot information
const parking = await getParking();
// Set up a recurring update
const update = async () => {
await updateParking(parking);
console.log(parking); // Logs the array of parking objects with updated 'full' status
setTimeout(update, 60 * 1000); // Check again in 1 minute
};
update();- Parking Facility Data: Static information about the parking lots (name, capacity, location) is fetched from an RDF source provided by the Sabae City open data platform.
- Real-time Sensor Data: Live full/vacant status is retrieved from a CSV endpoint on
mixsoda.io. - Data Fetching: A client-side proxy script,
fetchViaProxy.js, is used to handle cross-origin requests and convert JSONP responses to JSON. - Data Backup: A GitHub Actions workflow runs daily at 16:31 UTC to back up the sensor data.
This project utilizes open data from Sabae City.
MIT License