From d4fee994c9a659c71eb8bb0051d7080dfeb53273 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Tue, 2 Dec 2008 22:12:04 +0000 Subject: [PATCH] Don't shorten if the original link is a tinyurl or snipurl link git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@80 088b83a4-0077-4247-935c-42ec02c2848b --- commands.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/commands.yaml b/commands.yaml index b481c34..1418e86 100644 --- a/commands.yaml +++ b/commands.yaml @@ -1730,14 +1730,18 @@ TITLE: |- return; } - use WWW::Shorten::SnipURL; - my $short = makeashorterlink( $what ); - if( !$short ) { - use WWW::Shorten::TinyURL; - } - $short = makeashorterlink( $what ); - if( !$short ) { - $short = $what; + if( $what =~ /^https?:\/\/(snipurl|tinyurl)\.com\/.*/i ) { + $short = $what; + } else { + 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; -- 2.11.0