Skip to content

Instantly share code, notes, and snippets.

View Bertware's full-sized avatar

Bertware Bertware

View GitHub Profile
@Bertware
Bertware / arrivals.txt
Last active February 10, 2018 18:34
NMBS Mobile API Endpoints
POST http://www.belgianrail.be/jp/sncb-nmbs-routeplanner/mgate.exe HTTP/1.1
User-Agent: SNCB/302240 (Android_8.0.0) Dalvik/2.1.0 (Linux; U; Android 8.0.0; HTC 10 Build/OPR1.170623.027)
Content-Type: application/json;charset=UTF-8
Host: www.belgianrail.be
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 650
{"auth":{"aid":"sncb-mobi","type":"AID"},"client":{"id":"SNCB","name":"NMBS","os":"Android 8.0.0","type":"AND","ua":"SNCB/302240 (Android_8.0.0) Dalvik/2.1.0 (Linux; U; Android 8.0.0; HTC 10 Build/OPR1.170623.027)","v":302240},"formatted":false,"lang":"nld","svcReqL":[{"cfg":{"polyEnc":"GPA"},"meth":"StationBoard","req":{"date":"20180210","getPasslist":false,"getTrainComposition":false,"jnyFltrL":[{"mode":"BIT","type":"PROD","value":"11101111111111"}],"maxJny":50,"stbLoc":{"lid":"A=1@O=Brussel-Zuid@X=4336531@Y=50835707@U=80@L=008814001@B=1@p=1510534428@n=ac.1=GA@","name":"Brussel-Zuid","type":"S"},"time":"192234","type":"ARR"}}],"ver":"1.11"}
HTTP/1.1 200 OK
@Bertware
Bertware / station_en.json
Created December 11, 2017 00:16
HAFAS train stations in Europe
This file has been truncated, but you can view the full file.
{
"Stations": [
{
"Code": "ATAAB",
"Name": "Wien Mitte (At)",
"Enabled": "1",
"Synoniem": "Vienna",
"Query": "Wien Mitte (At) Vienna"
},
{
@Bertware
Bertware / Interrail Hafas Configuration.properties
Created December 11, 2017 00:13
Interrail (Hafas) configuration properties for the android app
# Wenn von Vorgängerversion verschieden werden alle daten gelöscht.
DATA_VERSION=4
# Server
BASE_QUERY=demo.hafas.de/bin/pub/std40
# Per GET zu schickende URL-Parameter
GETPARAMS=ld,checksum,mic,mac
# Suchmethode
@Bertware
Bertware / ValidateLCDepartures.php
Last active November 28, 2017 15:16
Validate LinkedConnections departures against departures found in the irail.be API.
<?php
// example call: ValidateLCDepartures.php station=0088xxxxx (where 0088xxxxx is a station ID)
parse_str(implode('&', array_slice($argv, 1)), $_GET);
$station = $_GET['station'];
// Get current datetime
$datetime = new DateTime();