Remove legacy IPS code. (#4451)

master
PJ Hampton 2017-08-21 21:09:09 +01:00 committed by Zaahir Moolla
parent 27e75cf8df
commit ad955d8469
2 changed files with 0 additions and 65 deletions

View File

@ -1,34 +0,0 @@
package DDG::Goodie::IPS;
# ABSTRACT: track a package through IPS.
use strict;
use DDG::Goodie;
zci is_cached => 1;
zci answer_type => "ips";
triggers query_nowhitespace_nodash => qr/(E[MA]\d{9})(IN|HR|)/xi;
handle query_nowhitespace_nodash => sub {
my $package_number = $1 . $2;
my $country = lc $2 || '';
my $tmp_link = '';
if ( $country eq 'in' ) {
$tmp_link = "http://ipsweb.ptcmysore.gov.in/ipswebtracking/IPSWeb_item_events.asp?itemid=$package_number&Submit=Submit";
}
elsif ( $country eq 'hr' ) {
$tmp_link = "http://ips.posta.hr/IPSWeb_item_events.asp?itemid=$package_number&Submit=Submit";
}
else {
$tmp_link = "http://mailtracking.gov.bm/IPSWeb_item_events.asp?itemid=$package_number&Submit=Submit+Query";
}
if ($tmp_link) {
return $package_number, heading => "IPS Shipment Tracking", html => qq(Track this shipment at <a href="$tmp_link">IPS</a>.);
}
return;
};
1;

31
t/IPS.t
View File

@ -1,31 +0,0 @@
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Deep;
use DDG::Test::Goodie;
zci answer_type => 'ips';
zci is_cached => 1;
ddg_goodie_test(
[qw( DDG::Goodie::IPS )],
'EM999999999IN' => test_zci(
"EM999999999IN",
heading => 'IPS Shipment Tracking',
html => qq(Track this shipment at <a href="http://ipsweb.ptcmysore.gov.in/ipswebtracking/IPSWeb_item_events.asp?itemid=EM999999999IN&Submit=Submit">IPS</a>.)
),
'em123456789hr' => test_zci(
"em123456789hr",
heading => 'IPS Shipment Tracking',
html => qq(Track this shipment at <a href="http://ips.posta.hr/IPSWeb_item_events.asp?itemid=em123456789hr&Submit=Submit">IPS</a>.)
),
'EM 999 999 999 IN' => test_zci(
"EM999999999IN",
heading => 'IPS Shipment Tracking',
html => qq(Track this shipment at <a href="http://ipsweb.ptcmysore.gov.in/ipswebtracking/IPSWeb_item_events.asp?itemid=EM999999999IN&Submit=Submit">IPS</a>.)
)
);
done_testing;