WebService::Nextbus::Agency - Superclass for data structures designed for Nextbus website (www.nextbus.com)
use WebService::Nextbus::Agency::SFMUNI; $muniAgency = new WebService::Nextbus::Agency::SFMUNI; @stopCodes = $muniAgency->str2stopCodes('N', 'O', 'Duboce and Fillmore');
$stopCodes can now be used as valid GET arguments on the nextbus webpage.
$stopCodes
WebService::Nextbus::Agency is conceived as a class of object used by WebService::Nextbus to store and intelligently recall the information that WebService::Nextbus will download from the Nextbus website. It class can also be used by initializing inheriting helper classes that will automatically load up the data relevant for the given agency.
However, the WebService::Nextbus package is not released yet, so the functionality of WebService::Nextbus::Agency is currently limited to the second method. Further, the only helper inheriting class I've written thus far is the class for the San Francisco MUNI agency (sf-muni). This subclass is available as WebService::Nextbus::Agency::SFMUNI.
The "SYNOPSIS" indicates how the object can be used to retrieve the GET argument that the website requires for returning GPS information for a particular stop on a particular route of the sf-muni agency. Once the proper GET code has been retrieved, a web useragent can use the argument to build a URL for the desired information. This is another function that will eventually be provided by WebService::Nextbus by making WebService::Nextbus an LWP::UserAgent.
None by default.
Watch out! No error checking yet...
None.
Peter H. Li<lt>pli9+CODE@spam-guard.itsa.ucsf.edu<gt>
Licensed by Creative Commons http://creativecommons.org/licenses/by-nc-sa/1.0/
WebService::Nextbus::Agency::SFMUNI, perl.
To install WebService::Nextbus::Agency, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Nextbus::Agency
CPAN shell
perl -MCPAN -e shell install WebService::Nextbus::Agency
For more information on module installation, please visit the detailed CPAN module installation guide.