summaryrefslogtreecommitdiff
path: root/bus.pl
diff options
context:
space:
mode:
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;