Skip to content

Instantly share code, notes, and snippets.

@burnoutberni
Created March 27, 2017 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save burnoutberni/7d158cea228d262307367366faa2ea48 to your computer and use it in GitHub Desktop.
Save burnoutberni/7d158cea228d262307367366faa2ea48 to your computer and use it in GitHub Desktop.
Sample Öffimonitor settings.js for location of Maker Faire 2017
// add your API key here
const api_key = 'XXXXXXXXXX';
// define all RBLs of stops you want to display
const api_ids = [
"967", // 86A, 87A
"5227", // 95A, 96A
"1040", // N26 -> Kagran
"1023", // N26 -> Eßling, Stadtgrenze
"1007", // 25 -> Aspern, Oberdorfstraße, 26A -> Großenzersdorf Busbahnhof
"1015", // 25 -> Floridsdorf, 26A -> Kagran
];
const api_url = 'http://www.wienerlinien.at/ogd_realtime/monitor' +
'?activateTrafficInfo=stoerunglang' +
`&sender=${api_key}`+
'&rbl=' + api_ids.join("&rbl=");
// define filters to exclude specific departures from the monitor
// currently you can exclude lines as a whole or only at certain stops
const filters = [
{
line: ['26A'],
stop: ['Polgarstraße'], // excludes lines only at given stop
},
];
// define your current location
const location_coordinate = '16.461746,48.231627'
// define OSRM server for routing to stops. Empty string to disable feature
const osrm_api_url = 'http://router.project-osrm.org/route/v1/foot/' + location_coordinate + ';'
module.exports = {
'api_url' : api_url,
'api_key' : api_key,
'api_ids' : api_ids,
'filters' : filters,
'api_cache_msec' : 6000, // cache API responses for this many milliseconds; default: 6s
'listen_port' : 8080, // port to listen on
'osrm_api_url' : osrm_api_url
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment