↓ Output (cached 60s)


<!DOCTYPE html>
<html lang="en">
  <head>
    <style type='text/css'>
      body {
        font-family: monospace;
        white-space: nowrap;
      }
      table {
        border-collapse: collapse;
      }
      th,td {
        border: 1px solid #eee;
        padding: 10px;
        vertical-align:top;
      }
      th:nth-child(1),th:nth-child(2) {
        text-align: left;
      }
      th:nth-child(3),td:nth-child(3) {
        text-align: center;
      }
      th:nth-child(4),td:nth-child(4) {
        text-align: right;
      }
    </style>
  </head>
  <body>
    <?php
      
require("OpenLDBWS.php");
      
$OpenLDBWS = new OpenLDBWS("YOUR_ACCESS_TOKEN");
      
$response $OpenLDBWS->GetDepBoardWithDetails(10,"GTW");
      
$template["header"] = "
        <table>
          <thead>
            <tr>
              <th>Time</th>
              <th>Destination</th>
              <th>Platform</th>
              <th>Expected</th>
            </tr>
          </thead>
          <tbody>
        "
;
      
$template["row"] = "
            <tr>
              <td>{std}</td>
              <td><strong>{destination}</strong>{detail}</td>
              <td>{platform}</td>
              <td>{etd}</td>
            </tr>
      "
;
      
$template["footer"] = "
          </tbody>
        </table>
      "
;

      if (isset(
$response->GetStationBoardResult))
      {
        print 
"<p><strong>".$response->GetStationBoardResult->locationName."</strong> Departures</p>";

        if (isset(
$response->GetStationBoardResult->nrccMessages))
        {
          print 
"<ul>";

          foreach(
$response->GetStationBoardResult->nrccMessages->message as $message)
          {
            print 
"<li>".$message->{"_"}."</li>";
          }

          print 
"</ul>";
        }

        if (isset(
$response->GetStationBoardResult->trainServices->service))
        {
          print 
$template["header"];

          foreach(
$response->GetStationBoardResult->trainServices->service as $service)
          {
            
$row $template["row"];

            
$destinations = array();

            foreach(
$service->destination->location as $location)
            {
              
$destinations[] = $location->locationName;
            }

            
$row str_replace("{std}",$service->std,$row);

            
$row str_replace("{destination}",implode(" and ",$destinations),$row);

            
$row str_replace("{platform}",(isset($service->platform)?$service->platform:"&nbsp;"),$row);

            
$row str_replace("{etd}",$service->etd,$row);

            
$detail "";

            if ((
$service->etd != "Cancelled") && isset($service->subsequentCallingPoints))
            {
              foreach(
$service->subsequentCallingPoints->callingPointList as $k => $callingPointList)
              {
                
$callingPoints $callingPointList->callingPoint;

                if (
$k)
                {
                  
$callingPoint array_shift($callingPoints);

                  
$detail .= "<p>Train divides at <strong>".$callingPoint->locationName."</strong></p>";
                }

                
$detail .= "<p>CALLING AT:</p>";

                foreach(
$callingPoints as $callingPoint)
                {
                  
$detail .= $callingPoint->locationName." (".(($callingPoint->st == "On time")?$callingPoint->et:$callingPoint->st).")<br />";
                }
              }

              
$detail .= "<p>".$service->operator.(isset($service->length)?" (".$service->length." coaches)":"")."</p>";
            }

            
$row str_replace("{detail}",$detail,$row);

            print 
$row;
          }

          print 
$template["footer"];
        }
        else
        {
          print 
"<p>No services within 2 hours.</p>";
        }
      }
    
?>
  </body>
</html>

Gatwick Airport Departures

Time Destination Platform Expected
06:13 Peterborough

CALLING AT:

Horley (06:15)
Salfords (06:20)
Earlswood (Surrey) (06:23)
Redhill (06:28)
Merstham (06:33)
Coulsdon South (06:38)
East Croydon (06:45)
London Bridge (07:00)
London Blackfriars (07:06)
City Thameslink (07:08)
Farringdon (07:11)
London St Pancras (Intl) (07:15)
Finsbury Park (07:22)
Stevenage (07:42)
Hitchin (07:48)
Arlesey (07:54)
Biggleswade (07:59)
Sandy (08:03)
St Neots (08:10)
Huntingdon (08:17)
Peterborough (08:34)

Thameslink (12 coaches)

2 On time
06:16 Cambridge

CALLING AT:

East Croydon (06:30)
London Bridge (06:45)
London Blackfriars (06:51)
City Thameslink (06:53)
Farringdon (06:56)
London St Pancras (Intl) (07:00)
Finsbury Park (07:07)
Stevenage (07:31)
Hitchin (07:38)
Letchworth Garden City (07:43)
Baldock (07:47)
Ashwell & Morden (07:52)
Royston (07:57)
Cambridge (08:13)

Thameslink (12 coaches)

4 06:22
06:18 Ore

CALLING AT:

Three Bridges (06:23)
Haywards Heath (06:32)
Wivelsfield (06:37)
Plumpton (06:44)
Cooksbridge (06:48)
Lewes (06:53)
Glynde (06:59)
Berwick (Sussex) (07:05)
Polegate (07:10)
Hampden Park (07:15)
Eastbourne (07:19)
Hampden Park (07:29)
Pevensey & Westham (07:34)
Cooden Beach (07:41)
Collington (07:44)
Bexhill (07:46)
St Leonards Warrior Square (07:53)
Hastings (07:56)
Ore (08:00)

Southern (4 coaches)

3 06:20
06:19 London Victoria

CALLING AT:

Horley (06:22)
Salfords (06:26)
Earlswood (Surrey) (06:30)
Redhill (06:34)
Merstham (06:49)
Coulsdon South (06:54)
Purley (06:58)
East Croydon (07:04)
Clapham Junction (07:14)
London Victoria (07:22)

Southern (4 coaches)

1 On time
06:25 Bedford

CALLING AT:

Horley (06:27)
Salfords (06:31)
Earlswood (Surrey) (06:35)
Redhill (06:39)
Merstham (06:44)
Coulsdon South (06:49)
Purley (06:53)
South Croydon (06:58)
East Croydon (07:01)
Norwood Junction (07:06)
London Bridge (07:20)
London Blackfriars (07:26)
City Thameslink (07:28)
Farringdon (07:31)
London St Pancras (Intl) (07:35)
St Albans (07:54)
Harpenden (08:00)
Luton Airport Parkway (08:06)
Luton (08:10)
Leagrave (08:14)
Harlington (08:19)
Flitwick (08:23)
Bedford (08:35)

Thameslink (12 coaches)

1 On time
06:26 Southampton Central

CALLING AT:

Three Bridges (06:31)
Crawley (06:36)
Ifield (06:39)
Faygate (06:43)
Littlehaven (06:47)
Horsham (06:51)
Christs Hospital (06:56)
Billingshurst (07:02)
Pulborough (07:09)
Amberley (07:15)
Arundel (07:20)
Ford (07:26)
Barnham (07:31)
Chichester (07:42)
Southbourne (07:49)
Emsworth (07:52)
Warblington (07:56)
Havant (07:58)
Cosham (08:07)
Portchester (08:12)
Fareham (08:17)
Swanwick (08:24)
Bursledon (08:28)
Hamble (08:31)
Netley (08:33)
Sholing (08:37)
Woolston (08:39)
Bitterne (08:43)
St Denys (08:45)
Southampton Central (08:52)

Southern (4 coaches)

7 06:30
06:32 Brighton

CALLING AT:

Brighton (06:59)

Gatwick Express (8 coaches)

7 On time
06:33 London Victoria

CALLING AT:

East Croydon (06:48)
Clapham Junction (06:58)
London Victoria (07:05)

Southern (8 coaches)

2 On time
06:36 Bedford

CALLING AT:

East Croydon (06:50)
London Bridge (07:05)
London Blackfriars (07:11)
City Thameslink (07:13)
Farringdon (07:16)
London St Pancras (Intl) (07:20)
West Hampstead Thameslink (07:29)
St Albans (07:41)
Harpenden (07:47)
Luton Airport Parkway (07:52)
Luton (07:56)
Leagrave (08:01)
Harlington (08:05)
Flitwick (08:09)
Bedford (08:21)

Thameslink (12 coaches)

4 On time
06:36 Brighton

CALLING AT:

Three Bridges (06:40)
Haywards Heath (06:50)
Wivelsfield (06:55)
Burgess Hill (06:57)
Hassocks (07:01)
Preston Park (07:07)
Brighton (07:11)

Thameslink (12 coaches)

7 On time