• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

MMM-Rejseplanen - A departure board for Danish train and bus stations

Scheduled Pinned Locked Moved Transport
19 Posts 10 Posters 8.8k Views 10 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    Manmachine
    last edited by Manmachine Mar 14, 2021, 4:32 PM May 5, 2017, 3:34 PM

    Hi,

    This is my first module
    A departure board for Danish train and bus stations.

    I’m programming in PowerShell at work, so I thought how hard can it be to learn Javascript?

    Boy! I was wrong!:laughing:

    That language has a syntax that is hysterical

    Well, with one hand in my hair (which is not too much of) and the other hand on the keyboard, some prayers to God, a large amount of coffee and coke a lot of Google search as well as even more useful inspiration from all the skilled programmers and the user of this forum. I has succeeded in making a useful piece of code.

    And, is finally stable.:stuck_out_tongue_winking_eye:

    Description:

    Train and bus departure board for Danish stations (InterCity, LYN, REG, S-Tog, BUS, EXB (Express Buss), NB (Night bus), Telebus, Ferry and Metro)

    Monitoring your favorite local departure station, with the next 20 departure for the destination. The data are from the Danish Findrejsen.dk API

    Screenshots:

    0_1493997996085_Example01.png

    Download:

    MMM-Rejseplanen

    Version 1.2.0

    • Support for number of departures returned

    Version 1.1.0

    • Better support for Metro train (direction)

    Version 1.0.0

    • Frist release, stable version
    1 Reply Last reply Reply Quote 2
    • Y Offline
      yawns Moderator
      last edited by May 6, 2017, 9:19 AM

      Looking at your screenshot I thought “that looks very familiar” :)

      Very nice work and thanks alot for the credits!

      1 Reply Last reply Reply Quote 0
      • B Offline
        B3nihana
        last edited by Aug 28, 2017, 8:32 PM

        Hey! I found your module and its really close to what I’m after! I’d like to be able to see when the next Metro train is leaving from a certain station, and in which direction its going (end station). Basically what you can see shown here: http://intl.m.dk/#!/stations/stationer/noerreport The information apparently is sourced from Rejseplanen so I would assume the API would cover it.

        If you have any hints on where to get started I’d be happy to hear them, I’ve got some basic experience with JavaScript but thought that you would be the best person to ask :)

        M 1 Reply Last reply Sep 3, 2017, 11:07 AM Reply Quote 0
        • M Offline
          Manmachine @B3nihana
          last edited by Sep 3, 2017, 11:07 AM

          @B3nihana
          Hey
          Just uploaded a new version, with a better support for Metro (direction). try it

          B 2 Replies Last reply Sep 4, 2017, 6:18 AM Reply Quote 1
          • B Offline
            B3nihana @Manmachine
            last edited by Sep 4, 2017, 6:18 AM

            @Manmachine Thanks! I’ll check it out and get back to you, what a great community this is!

            1 Reply Last reply Reply Quote 0
            • B Offline
              B3nihana @Manmachine
              last edited by Sep 4, 2017, 8:38 PM

              @Manmachine

              Trying the new version, I’m not sure I’m configuring the options correctly?

              If I only want to show Metro, I choose “M” under vehicle, but somehow all transport modes are still shown in the Mirror frontend. Secondly, the Metro stops don’t seem to be available in your list, and I assume that is due to the API lacking them? Is there anyway around this?

              Should it look something like this

                              {
                              module: 'MMM-Rejseplanen',
                              position: 'top_left',
                              header: 'Rejseplanen.dk',
                                      config: {
                                              stationID: "?",
                                              stationName: "Forum",
                                              vehicle: "M",
                                              destfilter: ""
                                      }
                              },
              
              

              I’d really appreciate any help you could provide!

              M 1 Reply Last reply Sep 5, 2017, 5:57 AM Reply Quote 0
              • M Offline
                Manmachine @B3nihana
                last edited by Sep 5, 2017, 5:57 AM

                @B3nihana

                The “hidden” features are in the destfilter:
                Try the following,
                Should give you all the Metro trains

                		{
                	module: 'MMM-Rejseplanen',
                	position: 'top_left',
                	header: 'Rejseplanen.dk',
                		config: {
                			stationID: "8600646",
                			stationName: "Nørreport",
                			vehicle: "T",
                			destfilter: "Metro"
                		}
                	},
                

                Or you can get all trains in one direction

                		{
                	module: 'MMM-Rejseplanen',
                	position: 'top_left',
                	header: 'Rejseplanen.dk',
                		config: {
                			stationID: "8600646",
                			stationName: "Nørreport",
                			vehicle: "T",
                			destfilter: "Vanløse"
                		}
                	},
                

                It was the easiest way to solve this, as well as the most flexible. Only require about 8 lines of code.

                And I’m a lazy man. So less code is really nice

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KuRIoS
                  last edited by Sep 13, 2018, 7:03 PM

                  Is there any way to only get the next 5 or 10 departures instead of 20?

                  M 1 Reply Last reply Sep 15, 2018, 2:01 PM Reply Quote 0
                  • M Offline
                    Manmachine @KuRIoS
                    last edited by Sep 15, 2018, 2:01 PM

                    @kurios said in MMM-Rejseplanen - A departure board for Danish train and bus stations:

                    departures

                    You can now configure the number of returned departures in the new updated version 1.2.0. Between 1 and 20 as max.

                    1 Reply Last reply Reply Quote 1
                    • M Offline
                      MarkNygaard
                      last edited by Oct 5, 2018, 5:16 PM

                      Thank you for the plugin it is very nice and just what I needed for displaying bus lines in Aarhus.

                      For others that might want to use a Station ID that is not in the list you can find nearby stops to your coordinates by using this URL: http://xmlopen.rejseplanen.dk/bin/rest.exe/stopsNearby?coordX=id&coordY=id&maxRadius=1000&maxNumber=30

                      Example:
                      GPS coordinates
                      Latitude: 55.67310756519397
                      Longitude: 12.565741539001467

                      http://xmlopen.rejseplanen.dk/bin/rest.exe/stopsNearby?coordX=12565796&coordY=55673063&maxRadius=1000&maxNumber=30

                      1 Reply Last reply Reply Quote 2
                      • 1
                      • 2
                      • 1 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy