Remove legacy IPS code. (#4451)
parent
27e75cf8df
commit
ad955d8469
|
@ -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
31
t/IPS.t
|
@ -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;
|
Loading…
Reference in New Issue