exit;
}
+TRAP: |-
+ sub {
+ my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
+ my $str = "";
+ for my $s (@{$heap->{ "servers" }}) {
+ if( $s->{ "ssid" } == $src ) {
+ if( $s->{ "trapEnabled" } ) {
+ $s->{ "trapEnabled" } = 0;
+ $kernel->post( $src, $replypath, "URL trapping now DISABLED. D:", $dest );
+ } else {
+ $s->{ "trapEnabled" } = 1;
+ $kernel->post( $src, $replypath, "URL trapping now enabled. :)", $dest );
+ }
+ }
+ }
+ return;
+ }
+
LINK: |-
sub {
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
my $res = $ua->request( $req );
if( $res->is_success ) {
my $content = $res->content;
- if( $content =~ /<title>(.*?)<\/title>/si ) {
+ if( $content =~ /<title[^>]*>(.*?)<\/title>/si ) {
use HTML::Entities;
my $title = decode_entities( $1 );
$title =~ s/[[:space:]]+/ /gs;