This is a small, fully static index.html tool that:
- extracts all
<binary>elements from a Mobilithek XML response - Base64-decodes them
- optionally gunzips them (when the decoded bytes are gzip)
- extracts FuelPricePublication time series and exports CSV (and keeps raw binaries downloadable)
On macOS you can just double-click start.command.
Or run it manually:
ruby server.rbThis serves the UI at http://127.0.0.1:5173 and provides /api/fetch so the page can fetch Mobilithek using your
.p12/.pfx client certificate (mTLS).
- Open
index.htmlin a modern browser (anywhere, includingfile://). - Get a Mobilithek response:
- Click Open endpoint in new tab (browser will handle client-certificate selection), then save/copy the XML.
- Or click Try fetch:
- with a selected
.p12/.pfx: uses the local helper server (recommended) - without a certificate: uses browser
fetch()(often blocked by CORS)
- with a selected
- Paste the XML into the textarea (or load the saved XML file) and click Decode binaries.
- Download CSV from the Fuel prices (time series) section, or download decoded binaries as
decoded_binaries.json/decoded_binaries.xmlto inspect before CSV conversion.
- The browser cannot use a user-selected
.p12/.pfxfor mTLS from JavaScript, and Mobilithek responses are often blocked by CORS. The Ruby helper server is the portable workaround. - You can change bind address/port:
HOST=127.0.0.1 PORT=5173 ruby server.rbIf you opened index.html via file:// and still want to use the helper server, open:
index.html?helper=http://127.0.0.1:5173
- Pure client-side
fetch()cannot attach a user-selected.p12/.pfxfor mTLS, and cross-origin responses are often blocked by CORS. Use the helper server if you need one-click fetching with the certificate. - Gzip decompression uses
DecompressionStream('gzip'). If your browser doesn’t support it, the tool will still let you download the Base64-decoded bytes (often a.gz).