Page 1 of 5

Dashticz - Module - Public Transport

Posted: Monday 15 May 2017 23:00
by robgeerts
First of all, thanks to @ultrara1n who started to build this module just the way the calendar- and trashmodule is coded too :)
In latest beta it is possible to show the timetable of the public transport company VVS (Germany) AND NS (Netherlands) with live data.

VVS:
To call the function properly, you will need the correct station id from: https://efa-api.asw.io/api/v1/station/
So for Stuttgart Central Station the station id is 5006118

Then add this to config.js:

Code: Select all

var publictransport = {}
publictransport.hbf= { show_via: true, station: '5006118', title:'Trains', show_lastupdate:true, provider: 'VVS', icon: 'train', interval: 15, results: 5 };
9292.nl:
First get the station id from http://api.9292.nl/0.1/locations?lang=nl-NL&q=eindhoven
(Change eindhoven to your own search parameter).
Then copy the id!

Code: Select all

//example station id: station-eindhoven
var publictransport = {}
publictransport.ovinfo= { show_via: true, station: 'station-eindhoven', title:'OV Info', show_lastupdate:true, provider: '9292', icon: 'train', results: 5 };
publictransport.ovinfotrain= { show_via: true, station: 'station-eindhoven', title:'Bus', show_lastupdate:true, provider: '9292-bus', icon: 'bus', results: 5 };
publictransport.ovinfobus= { show_via: true, station: 'station-eindhoven', title:'Trein', show_lastupdate:true, provider: '9292-train', icon: 'train', results: 5 };
Mobiliteit.lu:
To call the function properly, you will need the correct station name, for example:
Luxembourg/Centre, Royal

Then add this to config.js:

Code: Select all

var publictransport = {}
publictransport.ovinfobus = { key:'ovinfobus', show_via: false, station: 'Luxembourg/Centre, Royal', provider: 'mobiliteit',title:'Royal Stop',show_lastupdate:true, icon: 'bus', width:6,  results: 4}

icon is simply font-awesome without fa, interval = time in seconds for refreshing the data, and results = number of shown results. Also possible is to customize the width, but i would not change the value of 12 because of the size of the output.

If anyone can provide JSON-output from other transport companies, please send me a message and I will add these!

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 9:51
by robgeerts
In latest beta, NS is working too!

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 10:21
by EdwinK
Thanks again. I don't really need it, but it's good to see it can be placed

Don't know if you can use this, but this is a dataset of RET Rotterdam.

http://rotterdamopendata.nl/dataset/ret

There are more API's to be found from parking garages in Rotterdam (and maybe even other cities)

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 10:27
by qwerk
real nice, Dashticz is getting better and better, I have the stations I need.
Will there be a possibility for title? ( For I have multiple stations in view)
And is the bus also coming ??

Rob , keep up the good work.

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 11:22
by robgeerts
I was already looking into a timetable for buses.
I could use the 9292.nl-API..

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 12:40
by robgeerts
Check latest beta :)
And first post of this topic for the configuration ;)

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 13:15
by qwerk
that was quick ( as always)
do you use the word "station" in the script?
I would like to use the nearest busstop,

normally you would give station-village station-arnhem
but now I would like to be able to http://9292.nl/andelst/bushalte-wilhelminastraat

Is that do-able?

goodluck.....

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 13:16
by robgeerts
Yes, use:

Code: Select all

var publictransport = {}
publictransport.ovinfobus= { station: 'andelst/bushalte-wilhelminastraat', provider: '9292-bus', icon: 'bus', results: 5 };

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 13:24
by qwerk
I get nothing anymore ( transportation) herokuapp issues?
exception
:
{type: "System.Web.HttpException", message: "Not Found"}
message
:
"Not Found"
type
:
"System.Web.HttpException"

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 13:30
by robgeerts
qwerk wrote: Will there be a possibility for title? ( For I have multiple stations in view)
Title now possible (see startpost for example config)
Download latest beta!

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 16:01
by vgr2
Hi rob, with some of your last update multiple stations did not work correctly in showing the time at the 5 results. First station looks fine, second and more station only the last result is correct. 1-4 results are not updated. Can You check this please?

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 16:56
by qwerk
My bus and train stations all look fine and are updated.

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 16:57
by robgeerts
Mine are updated too..

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 18:15
by blacksn0w
What are about the "loading..." text, why not updating it silent in the background instead of creating this visual distraction?

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 18:17
by vgr2
That's my. Only first station is ok.

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 18:18
by robgeerts
Could you send me your config?

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 18:27
by vgr2
I had send you my config by PN

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 20:43
by robgeerts
vgr2 wrote:I had send you my config by PN
Thansk, could you test latest beta version?
blacksn0w wrote:What are about the "loading..." text, why not updating it silent in the background instead of creating this visual distraction?
Fixed in latest beta version!

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 21:06
by freakshock
Idea for a configurable feature for this module:
How about making it possible to exclude results between the current time and the first departure time listed?

For instance: I have added my local trainstation near my house. It takes at least 15 minutes from my house to get there. It would be nice to be able to exclude results that show the trains leaving from the current time +15 minutes.

If I don't have this feature I have to make my list really long :lol:

Re: Dashticz - Module - Public Transport

Posted: Tuesday 16 May 2017 21:36
by vgr2
Now it's perfect,

Is there a possibility for me to change the font size?