dashticz - time to work
Posted: Monday 04 November 2019 13:10
Hi,
I'm new to dashticz I wanna add a block that shows my transit time to work or other places.
I am using a local service. In the documentation it says i should send a GET request:
the parameters are origin and destination as: latitude,longitude.
then the result would be
from this list i want to display "summary" and duration "value" which is in seconds converted to hours:minutes on my dashboard like this:
It will take you HH:MM to work using THE_NAME_OF_THE_ROAD.
My js knowledge is pretty basic (zero to be honest) and can't figure out how to do this.
can any one help?
I'm new to dashticz I wanna add a block that shows my transit time to work or other places.
I am using a local service. In the documentation it says i should send a GET request:
Code: Select all
GET:
https://api.neshan.org/v2/direction?parameters
Headers:
Api-Key: YOUR_API_KEY
then the result would be
Code: Select all
{
"routes": [
{
"legs": [
{
"summary": "آزادی - ولیعصر",
"distance": {
"value": 8998,
"text": "۹ کیلومتر"
},
"duration": {
"value": 2012,
"text": "۳۴ دقیقه"
},
"steps": [
{
"name": "عضدی جنوبی",
"instruction": "در جهت شرق در عضدی جنوبی قرار بگیرید",
"distance": {
"value": 46,
"text": "۴۶ متر"
},
"duration": {
"value": 11,
"text": "کمتر از ۱ دقیقه"
},
"polyline": "qxu|EkpcjJb@{@Tc@b...",
"maneuver": "depart",
"start_location": [
51.344035,
35.695452
]
}
]
}
],
"overview_polyline": {
"points": "qwzxEgckxHBeAWEDq ..."
}
}
]
}
It will take you HH:MM to work using THE_NAME_OF_THE_ROAD.
My js knowledge is pretty basic (zero to be honest) and can't figure out how to do this.
can any one help?