travel
by IrisTravel time from home to an address, free via OSRM and optionally with live traffic via TomTom, including when to leave.
or say to your Iris: install travel
Installs in your Iris ยท
Travel
Travel time from home to an address. Free and keyless via OSRM; optionally with live traffic via TomTom, and with a "when to leave" hint.
What it does
travel- the home address and which route service is usedtravel huis "<address>"- set the home address (looked up once and stored)travel naar "<address>"- distance and travel time from hometravel naar "<address>" --om 14:30- also say when to leave to arrive at 14:30
The home address is not secret and lives in config.json next to this plugin:
{ "home": { "address": "Damrak 1, Amsterdam", "lat": 52.377, "lon": 4.898 } }
travel huis fills it by itself.
Route service
- Default: OSRM at
https://router.project-osrm.org/route/v1/driving/...- a free demo server, no key, no live traffic. Distance and duration only. - Optional: TomTom Routing API when a key is in the vault. Then the plugin uses TomTom with
traffic=true, which takes current (and, with--om, predicted) traffic into account:
``sh kluis vraag reistijd --domein api.tomtom.com "TomTom Routing API key" ``
The plugin never reads the TomTom key. The call is made by the vault itself, with the key filled in as {g} in the URL; only the answer comes back.
Address lookup
Addresses are looked up with Photon (https://photon.komoot.io/api/), a free OpenStreetMap geocoder. Give a city or postcode along with the street for an exact match.
API
GET https://photon.komoot.io/api/?q=...&limit=1- geocodingGET https://router.project-osrm.org/route/v1/driving/{lon},{lat};{lon},{lat}?overview=false-routes[0].distancein metres androutes[0].durationin secondsGET https://api.tomtom.com/routing/1/calculateRoute/{lat},{lon}:{lat},{lon}/json?key={g}&traffic=true-routes[0].summary.travelTimeInSecondsandroutes[0].summary.lengthInMeters
With --om and a TomTom key the route is asked for the estimated departure time, so the traffic prediction fits that moment.
Iris Apps