This week I received a lot of submissions to airportpianos.org, the index of pianos in airports that I maintain. Submissions come through a Google Form. The form is intentionally brief , asking for two pieces of information: the airport name and the location of the piano.
When I receive a submission, I fill out a JSON entry and add it to the list of pianos. This list is then used to generate the static airportpianos.org web site. You can see the raw data used to generate the site on GitHub.
I regularly make small errors when adding new entries by hand. The most common one is adding a comma to the end of a JSON entry — which you can’t do! — or forgetting a comma after a value where one is needed.
This week I created a web form that generates the JSON record for me. The form is a static HTML page. When you submit the form, a JavaScript script reads the contents of the form fields and generates the JSON record that I can then paste into the list.
The form has a few addiitonal features. FIrst, if I type an IATA code — an “airport code” — that is already listed on the site, I get a warning to tell me the entry already exists. This will prevent me from making duplicate entries, and make sure I go to check the existing information to make sure it matches the most recent submission for the airport piano.
Second, I added two links:
- Search for IATA
- Search for lat long
The former takes the name of the airport and creates a Google Search link for {airport name} airport code
. Google usually returns a big box showing the airport code, which makes data entry easier for me. The same is true of latitude and longitude, too.
Here is an example of a final record generated by the web form:
{
"iata": "CPH",
"title": "Copenhagen Kastrup International Airport",
"city": "Copenhagen",
"state": "Copenhagen",
"country": "Denmark",
"lat": "55.6120",
"long": "12.6477",
"zoom": "12",
"hasPiano": "true",
"pianoShortLocation": "Terminal 3",
"lastConfirmed": "2025",
"description": "There is a piano for public use located at Terminal 3.",
"slug": "cph"
}
The record is valid JSON that I can add to the list of pianos.
This implementation follows the same principles behind my publish tool that I use to publish blog posts on my site: create a web form that, with JavaScript, generates data in the structure that a static site generator expects.