NAME
WWW::TubeUpdates - Interface to Tube Updates API.
VERSION
Version 0.01
DESCRIPTION
A very lightweight wrapper for the Tube Updates REST API provided by tubeupdates.com.
CONSTRUCTOR
The constructor requires optionally format type. It can be either XML / JSON. The default type is JSON.
use strict; use warnings;
use WWW::TubeUpdates;
my ($tube);
$tube = WWW::TubeUpdates->new('xml');
# or
$tube = WWW::TubeUpdates->new(format => 'xml');
# or
$tube = WWW::TubeUpdates->new({format => 'xml'});
METHODS
getStatus()
Returns the status of the given tube lines. Tube lines can be passed in as list or reference to a list. Following is the list of valid tube lines:
+-----------------+-----------------------------------------------------------+
| Id | Description |
+-----------------+-----------------------------------------------------------+
| all | Wildcard for all lines |
| bakerloo | Bakerloo Line |
| central | Central Line |
| circle | Circle Line |
| district | District Line |
| docklands | Docklands |
| hammersmithcity | Hammersmith & City Line |
| jubilee | Jubilee Line |
| metropolitan | Metropolitan Line |
| northern | Northern Line |
| piccadilly | Piccadilly Line |
| overground | London Overground system |
| tube | Wildcard for all tube lines (excludes DLR and Overground) |
| victoria | Victoria Line |
| waterloocity | Waterloo & City Line |
+-----------------+-----------------------------------------------------------+
use strict; use warnings;
use WWW::TubeUpdates;
my $tube = WWW::TubeUpdates->new('xml');
print $tube->getStatus('circle') . "\n";
# or
print $tube->getStatus(['circle']) . "\n";
# or
print $tube->getStatus('circle', 'bakerloo') . "\n";
# or
print $tube->getStatus(['circle', 'bakerloo']) . "\n";
AUTHOR
Mohammad S Anwar, <mohammad.anwar at yahoo.com>
BUGS
Please report any bugs or feature requests to bug-www-tubeupdates at rt.cpan.org
or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-TubeUpdates. I will be notified & then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc WWW::TubeUpdates
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENT
Ben Dodson (author of TubeUpdates REST API).
LICENSE AND COPYRIGHT
Copyright 2011 Mohammad S Anwar.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
DISCLAIMER
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.