refactor of #543

master
Zaahir Moolla 2014-07-09 10:51:15 -04:00
parent ef7a86d7d0
commit fec94ad170
1 changed files with 8 additions and 10 deletions

View File

@ -35,16 +35,14 @@ triggers query_nowhitespace_nodash => qr/
handle query_nowhitespace_nodash => sub {
my $parcel_number = $+{parcel_number};
# Exit if $parcel_number doesn't exist.
return unless $parcel_number;
# Exit if $parcel_number starts with ISBN.
return if $parcel_number =~ /^isbn/i;
if ($parcel_number && $parcel_number !~ /^isbn/i) {
return $parcel_number,
heading => 'Parcelforce Tracking',
html =>
qq(Track this parcel at <a href="http://www.parcelforce.com/track-trace?trackNumber=$parcel_number">Parcelforce</a>.);
};
};
return;
};
1;