From 27e75cf8df408c68ab299cd07dad13afc98e1ab4 Mon Sep 17 00:00:00 2001 From: PJ Hampton <pjhampton@users.noreply.github.com> Date: Mon, 21 Aug 2017 21:08:54 +0100 Subject: [PATCH] Removed legacy HKDK. (#4448) --- lib/DDG/Goodie/HKDK.pm | 25 ------------------------- t/HKDK.t | 26 -------------------------- 2 files changed, 51 deletions(-) delete mode 100644 lib/DDG/Goodie/HKDK.pm delete mode 100644 t/HKDK.t diff --git a/lib/DDG/Goodie/HKDK.pm b/lib/DDG/Goodie/HKDK.pm deleted file mode 100644 index 40db6b46a0f..00000000000 --- a/lib/DDG/Goodie/HKDK.pm +++ /dev/null @@ -1,25 +0,0 @@ -package DDG::Goodie::HKDK; -# ABSTRACT: Track a package through HKDK. - -use strict; -use DDG::Goodie; - -zci is_cached => 1; -zci answer_type => "hkdk"; - -triggers query_nowhitespace_nodash => qr/([a-z]{2}\d{9}(?:hk|dk))/i; - -handle query_nowhitespace_nodash => sub { - my $package_number = $1; - - if ( $package_number =~ /hk$/i ) { - return $package_number, heading => 'Hongkong Post Shipment Tracking', html => qq(Track this shipment at <a href="http://app3.hongkongpost.com/CGI/mt/genresult.jsp?tracknbr=$package_number">Hongkong Post</a>.); - } - elsif ( $package_number =~ /dk$/i ) { - return $package_number, heading => 'Post Norden Shipment Tracking', html => qq(Track this shipment at <a href="http://www.postdanmark.dk/tracktrace/TrackTrace.do?i_stregkode=$package_number">Post Norden</a>.); - } - - return; -}; - -1; diff --git a/t/HKDK.t b/t/HKDK.t deleted file mode 100644 index 0b59b18fa2b..00000000000 --- a/t/HKDK.t +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Test::More; -use Test::Deep; -use DDG::Test::Goodie; - -zci answer_type => 'hkdk'; -zci is_cached => 1; - -ddg_goodie_test( - [qw( DDG::Goodie::HKDK )], - 'CU123456789DK' => test_zci( - "CU123456789DK", - heading => 'Post Norden Shipment Tracking', - html => qq(Track this shipment at <a href="http://www.postdanmark.dk/tracktrace/TrackTrace.do?i_stregkode=CU123456789DK">Post Norden</a>.) - ), - 'EE123456789HK' => test_zci( - "EE123456789HK", - heading => 'Hongkong Post Shipment Tracking', - html => qq(Track this shipment at <a href="http://app3.hongkongpost.com/CGI/mt/genresult.jsp?tracknbr=EE123456789HK">Hongkong Post</a>.) - ), -); - -done_testing;