From 8419b80b1b206262c42fee46cb2b9cc632904509 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 27 May 2013 16:38:46 +0100 Subject: kill debug Data::Printer --- bus.pl | 16 ---------------- forecast-file.pl | 57 -------------------------------------------------------- lib/TFL/Bus.pm | 2 -- 3 files changed, 75 deletions(-) delete mode 100644 bus.pl delete mode 100644 forecast-file.pl diff --git a/bus.pl b/bus.pl deleted file mode 100644 index 0e25ead..0000000 --- a/bus.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.014; -use TFL::Bus; -use Data::Printer; - -my $bus = TFL::Bus->new(); - -my $res = $bus->request(TFL::Bus::Request->new({ - StopPointName => 'Hotspur Road', - #Towards => 'Islip Manor', - ReturnList => [qw(StopID StopCode1 VisitNumber TripID VehicleID LineID LineName DirectionID DestinationText DestinationName EstimatedTime)], -})); - -p $res; diff --git a/forecast-file.pl b/forecast-file.pl deleted file mode 100644 index 02dba1c..0000000 --- a/forecast-file.pl +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; -use 5.014; -use WebService::ForecastIo::Response; -use Path::Class; -use Template::Provider::Encoding; -use Template::Stash::ForceUTF8; -use Template; - -my %icon_for=( - 'clear-day' => '2', - 'clear-night' => '3', - rain => '18', - snow => '23', - sleet => '24', - wind => '6', - fog => '13', - cloudy => '14', - 'partly-cloudy-day' => '8', - 'partly-cloudy-night' => '9', -); - -sub icon_for { - my ($status) = @_; - - return "icons/".($icon_for{$status}//'45').".svg"; -} - -my $res = WebService::ForecastIo::Response->new( - file($ARGV[0])->slurp(iomode=>'<:raw') -); -my $tf = file(__FILE__)->parent->file('forecast.html.tt'); -my $t = Template->new( - LOAD_TEMPLATES => [ Template::Provider::Encoding->new( - ABSOLUTE => 1, - RELATIVE => 1, - ) ], - STASH => Template::Stash::ForceUTF8->new, -); -binmode STDOUT,':utf8'; -$t->process($tf->stringify,{ - f => $res, - icon_for => \&icon_for, -}) - or die $t->error; - -__DATA__ -[% MACRO dtspan BLOCK -%] -<[% x.start_time.strftime('%H:%M%z') %] - [%x.stop_time.strftime('%H:%M%z') %]> [% x.value %] -[%- END -%] -Currently: [% f.currently.summary %] [% f.currently.temperature %]° -[% f.hourly.summary %] - -[% FOREACH x IN f.hourly.spans_by_string('summary'); dtspan(x=x); ' '; END %] -[% FOREACH x IN f.hourly.spans_by_number('temperature',2); dtspan(x=x); ' '; END %] - diff --git a/lib/TFL/Bus.pm b/lib/TFL/Bus.pm index d704f19..820d630 100644 --- a/lib/TFL/Bus.pm +++ b/lib/TFL/Bus.pm @@ -102,8 +102,6 @@ sub request { if ($http_response->is_success) { my $json = $http_response->content; - use Data::Printer;p $json; - return TFL::Bus::Response->new_from_json( $request->ReturnList, $json -- cgit v1.2.3