Git Product home page Git Product logo

mmm-hk-kmb's Introduction

MMM-HK-KMB

Station monitor for the Hong Kong KMB.

This module is an extension of the amazing MagicMirror2 project by MichMich which has inspired me to share my coding skills with others as well. Check it out, you know you want to :).

It's always nice to see mirrors using my work, so feel free to send me some screenshots of your implementations.

Lastly, why not join in on our discussions at the official MagicMirror2 Forum?

Screenshots

Chinese version English version

Current version

v1.0.0

Languages

As of version 1.0.0, MMM-HK-KMB features language support for Chinese (zh) and English (en) mirrors.

Prerequisite

A working installation of MagicMirror2

Dependencies

Installation

  1. Navigate into your MagicMirror's modules folder.
  2. Execute git clone https://github.com/winstonma/MMM-HK-KMB.git.
  3. Execute cd MMM-HK-KMB.
  4. Execute npm install.

Module behavior

Please note that this module auto-creates a module header which displays the name of the chosen Hong Kong local transport stop. It is therefore recommended not to add a 'header' entry to your config.js for this module.

This module automatically disappears from your mirror as soon as a station has stopped offering connections at night. It reappears as soon as your chosen station is scheduled to be served again.

This module has been programmed to allow for multiple instances. Simply add more MMM-HK-KMB config entries to your config.js file to display multiple stations and configure them according to your needs.

Configuration

Sample minimum configuration entry for your ~/MagicMirror/config/config.js:

...

{
    module: 'MMM-HK-KMB',
    position: 'top_left',
    config: {
        stops: [
            {
                stopID: 'HO06-S-1250-0',		// Which stop would you like to have displayed?	
            }
        ]
    }
} 						// If this isn't your last module, add a comma after the bracket

...

Sample configuration entry for your ~/MagicMirror/config/config.js with optional parameters:

...

{
    module: 'MMM-HK-KMB',
    position: 'top_left',
    config: {
        stops: [
            {
                stopID: 'HO06-S-1250-0',		// Which stop would you like to have displayed?	
            }
        ],
        labelRow: true, // Show or hide column headers
        reload: 60000 	// How often should the information be updated? (In milliseconds)
    }
} 						// If this isn't your last module, add a comma after the bracket

...

Figuring out the correct stopID

  1. Open your web browser and navigate to the KMB Mobile Page.
  2. Use the top search field to find the Line that the stop will stopped.
  3. Once you can see the stop in your browser, click the Map.
  4. When a new page is being displayed, check the link (e.g. http://www.kmb.hk/chi/map.php?file=HO06-S-1250-0). Note the last portion of the link (e.g. HO06-S-1250-0)is the StopID you are looking for.

Config Options

Option Default Description
stopID HO06-S-1250-0
Which stop would you like to have displayed?
Default: HO06-S-1250-0

stopName Stop
How would you want the stop name be displayed?
Default: Stop

labelRow
optional
true
Show or hide column headers
Possible values: true, false

reload
optional
60000
How often should the information be updated? (In milliseconds)
Default: Every minute

Licence

MIT License

Copyright (c) 2016 Winston (https://github.com/winstonma/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

mmm-hk-kmb's People

Contributors

winstonma avatar fewieden avatar jimmykh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.