return;
}
- use WWW::Shorten::TinyURL;
-
+ use WWW::Shorten::SnipURL;
+ my $short = makeashorterlink( $what );
+ if( !$short ) {
+ use WWW::Shorten::TinyURL;
+ }
+ $short = makeashorterlink( $what );
+ if( !$short ) {
+ $short = $what;
+ }
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(5);
my $title = decode_entities( $1 );
$title =~ s/[[:space:]]+/ /gs;
$title =~ s/(^[[:space:]]*)|([[:space:]]*$)//gs;
- $kernel->post( $src, $replypath, BOLD . makeashorterlink( $what ) . NORMAL . " ($title)", $dest );
+ $kernel->post( $src, $replypath, BOLD . $short . NORMAL . " ($title)", $dest );
} else {
- $kernel->post( $src, $replypath, BOLD . makeashorterlink( $what ) . NORMAL, $dest );
+ my $resp = BOLD;
+ $resp .= $short;
+ $resp .= NORMAL;
+ $kernel->post( $src, $replypath, $resp, $dest );
}
}
}