
WebService::OCTranspo - Access Ottawa bus schedule information from www.octranspo.com

use WebService::OCTranspo;
my $oc = WebService::OCTranspo->new();
my $schedule = $oc->schedule_for_stop({
stop_id => $stop,
route_id => $route,
date => DateTime->now(),
});
print "$s->{route_number} - $s->{route_name} departing $s->{stop_name} ($s->{stop_number})\n";
foreach my $time ( @{ $s->{times} } ) {
print " $time\n";
}

This module provides access to some of the bus schedule information available from OCTranspo -- the public transit service in Ottawa, Ontario, Canada.

Creates a new WebService::OCTranspo object
Fetch schedule for a single route at a single stop. Returns reference to hash containing schedule info for that route at that stop.
$args must be a hash reference containing all of:
The numeric ID of the bus stop. This should be the "560 Code" displayed at each stop, usually used for retrieving the bus stop information by phone.
The bus route number. Use integers only -- 'X' routes should omit the X suffix.
A DateTime object
Return hashref contains:
4-digit OC Transpo stop number
Name of stop, or 'unknown' if not found
1 to 3 digit OC Transpo route number
Name of route, or 'unknown' if not found
Reference to array of scalars representing stop times in local Ottawa time. Time values will be in one of two formats: HH:MM for plain times with no modifier, and HH:MM (X) where X is the identifier of a route note mentioned in the notes section of the returned data.
Reference to hash, containing note_identifier => note.
This method will die if the stop is not found, the route is not found, as well as on any WWW::Mechanize or HTML::Form errors that might be thrown.

WWW::Mechanize, HTML::Form::ForceValue, HTML::TableExtract, HTTP::Status, DateTime

There are no known incompatibilities with this module, but they probably do exist.

Current known issues:
Please report any new problems to the author. Patches are welcome.

Dave O'Neill (dmo@dmo.ca)

Copyright (C) 2007 Dave O'Neill
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.