$xml = simple_get_xml('http://www.cotrip.org/atis/web.TraveltimeMarshal');
$table = $xml->xpath('/html/body/table[3]');
foreach ($table[0]->tr as $item) {
}
else {
if ($item->td[0] == 'Route Description') {
// First row - throw this away.
}
else {
$d = $item->td;
// This is a time line - store the data.
db_query("INSERT INTO {time_travel} (timestamp, direction, description, ideal_time, estimated_time, speed, generated, length) VALUES (%d, '%s', '%s', %d, %d, %d, '%s', %d)",
time(),
$direction,
$d[0],
$d[1],
$d[2],
$d[3],
$d[4]['font'],
$d[5]);
}
}
}