Acme-Terror-UK

 view release on metacpan or  search on metacpan

lib/Acme/Terror/UK.pm  view on Meta::CPAN


Gets the currrent terrorist threat level in the UK.

The levels are either...
 CRITICAL - an attack is expected imminently 
 SEVERE - an attack is likely
 SUBSTANTIAL - an attack is a strong possibility
 MODERATE - an attack is possible but not likely
 LOW - an attack is unlikely

This module aims to be compatible with the US version, Acme::Terror

=head1 METHODS

=head2 new()

  use Acme::Terror::UK
  my $t = Acme::Terror::UK->new(); 

Create a new instance of the Acme:Terror::UK class.

=head2 fetch()

  my $threat_level_string = $t->fetch();
  print $threat_level_string;

Return the current threat level as a string.

=head2 level()

  my $level = $t->level();
  if ($level == Acme::Terror::UK::CRITICAL) {
    print "Help, we're all going to die!\n";
  }

Return the level of the current terrorist threat as a comparable value.

The values to compare against are,

  Acme::Terror::UK::CRITICAL
  Acme::Terror::UK::SEVERE
  Acme::Terror::UK::SUBSTANTIAL
  Acme::Terror::UK::MODERATE
  Acme::Terror::UK::LOW

If it can't retrieve the current level, it will return

  Acme::Terror::UK::UNKNOWN

=head1 BUGS

This module just screenscrapes the MI5 website so is vulnerable
to breaking if the page design changes.

=head1 SEE ALSO

Acme::Terror
http://www.mi5.gov.uk/
http://www.mi5.gov.uk/output/Page4.html
http://www.intelligence.gov.uk/
http://www.homeoffice.gov.uk/security/current-threat-level/

=head1 THANKS

Neil Stott for supplying a patch after MI5 site redesign
B10m for supplying a patch after an MI5 site redesign

=head1 AUTHOR

Robert Price, E<lt>rprice@cpan.orgE<gt>


=head1 COPYRIGHT AND LICENSE

Copyright (C) 2006-2010 by Robert Price

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.


=cut



( run in 1.552 second using v1.01-cache-2.11-cpan-5a3173703d6 )