summaryrefslogtreecommitdiff
path: root/bus.pl
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2013-05-13 22:07:59 +0100
committerdakkar <dakkar@thenautilus.net>2013-05-16 20:28:34 +0100
commita62c66c5c4a9d55ab04444efeb3d389461774e76 (patch)
tree7e6eb1413dcda4dc45bb0c99ca88db7330c25256 /bus.pl
parentweather forecast (diff)
downloadHomePanel-a62c66c5c4a9d55ab04444efeb3d389461774e76.tar.gz
HomePanel-a62c66c5c4a9d55ab04444efeb3d389461774e76.tar.bz2
HomePanel-a62c66c5c4a9d55ab04444efeb3d389461774e76.zip
Bus API module
Diffstat (limited to 'bus.pl')
-rw-r--r--bus.pl15
1 files changed, 7 insertions, 8 deletions
diff --git a/bus.pl b/bus.pl
index ba82c4b..0e25ead 100644
--- a/bus.pl
+++ b/bus.pl
@@ -2,16 +2,15 @@
use strict;
use warnings;
use 5.014;
-use LWP::Simple;
-use URI;
-use URI::QueryParam;
+use TFL::Bus;
+use Data::Printer;
-my $base = URI->new('http://countdown.api.tfl.gov.uk/interfaces/ura/instant_V1');
+my $bus = TFL::Bus->new();
-$base->query_form({
+my $res = $bus->request(TFL::Bus::Request->new({
StopPointName => 'Hotspur Road',
#Towards => 'Islip Manor',
- ReturnList => 'StopID,StopCode1,VisitNumber,TripID,VehicleID,LineID,LineName,DirectionID,DestinationText,DestinationName,EstimatedTime',
-});
+ ReturnList => [qw(StopID StopCode1 VisitNumber TripID VehicleID LineID LineName DirectionID DestinationText DestinationName EstimatedTime)],
+}));
-say get($base);
+p $res;