Acme-Terror-UK
view release on metacpan or search on metacpan
lib/Acme/Terror/UK.pm view on Meta::CPAN
use constant CRITICAL => 1;
use constant SEVERE => 2;
use constant SUBSTANTIAL => 3;
use constant MODERATE => 4;
use constant LOW => 5;
sub new {
my ($class, %args) = @_;
$class = ref($class) if (ref $class);
return bless(\%args, $class);
}
sub fetch {
my $self = shift;
my $url = 'http://www.mi5.gov.uk/';
my $html = get($url);
return undef unless ($html);
my ($lvl) = ($html =~ m!</a>Current UK threat level</strong></p>.+?<h3><font style="FONT-SIZE: 12pt">(.+?)</font></h3>!sgi);
return $lvl;
}
( run in 1.883 second using v1.01-cache-2.11-cpan-de7293f3b23 )