iRail & betrains

1,085 views

Published on

  • Be the first to comment

  • Be the first to like this

iRail & betrains

  1. 1. iRail & BeTrains @KevinVanWilder
  2. 2. iRail API /stations/<stations timestamp="050810"> <station locationX="4.038586" locationY="50.1345678"> AALST </station> ...</stations>
  3. 3. iRail API/liveboard/?station=STATIONNAME /liveboard/?id=BE.NMBS.1 <liveboard version="1.0“ timestamp="123456789"> <station locationX="4.21485" locationY="..."> GENT ST P [B] </station> <departures number="2"> <departure delay="xx" id="0"> <station locationX="..." locationY="..."> STATIONNAME </station> <vehicle> Be.NMBS.P2000 </vehicle> <time formatted="iso8601">U</time> <platform>X</platform> </departure> ... </departures> </liveboard>
  4. 4. iRail API• Train schedules /connections/?to=STATION1&from=STATION2• List all stations /stations/• Station liveboard /liveboard/?station=STATIONNAME• Vehicle information /vehicle/?id=Be.NMBS.P1234
  5. 5. 1800016000140001200010000 8000 6000 4000 2000 0 2/10/2010 2/11/2010 2/12/2010 2/01/2011
  6. 6. iRailForJIRail iRail = new IRail("http://api.irail.be","nl");List<Connection> connections = iRail.getConnections("LIEDEKERKE","BRUSSEL CENTRAAL");for(Connection connection : connections) { TripNode departure = connection.getDeparture(); TripNode arrival = connection.getArrival(); departure.getStation().getName() // Schaerbeek departure.getVehicle().getType() // IC2367 departure.getDelay() // 60}
  7. 7. Old: http://code.google.com/p/betrains/New: http://code.google.com/p/betrains-android/ http://project.irail.be

×