Don't shorten if the original link is a tinyurl or snipurl link
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Tue, 2 Dec 2008 22:12:04 +0000 (22:12 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Tue, 2 Dec 2008 22:12:04 +0000 (22:12 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@80 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml

index b481c34..1418e86 100644 (file)
@@ -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;