🚌 Oma matkakortti (OMK) API
Unofficial oma matkakortti API for Node.js
Oma matkakortti is a web service that allows HSL (Helsingin Seudun Liikenne) users to get information about their travel cards. This is an unofficial Node.js API for getting (and possibly setting in the future) information using the web service.
Please note that this library cannot (yet) add new cards, so you should that manually in the web portal.
Usage
A simple example:
const OMK = ; const omk = ; omk // change these;
Methods
Promise
login(username, password) ⇒ Logs the user in with an username and a password. Resolves on successful login.
Parameters
Name | Type | Description |
---|---|---|
username | string |
username of the user |
password | string |
password of the user |
Promise<Array<Object>>
getCards() ⇒ Fetches all the cards of the user and caches them for next time.
Note: Even though the array has objects with lots of information, only id
and name
are accurate; others are bogus.
Promise<Object>
getCard(id) ⇒ gets information about a specific card
Parameters
Name | Type | Description |
---|---|---|
id | string |
the id of the card |