Tweak RSS a bit, so that we can choose not to shorten URLs if they're already shorten...
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 1 Jun 2009 20:55:16 +0000 (20:55 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 1 Jun 2009 20:55:16 +0000 (20:55 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@96 088b83a4-0077-4247-935c-42ec02c2848b

commands.yaml

index d158ef4..4d49136 100644 (file)
@@ -968,9 +968,10 @@ RSS: |-
         my $ownline = 0;
         my $compress = 0;
         my $oneline = 0;
+        my $shorten = 1;
         my $elem = $arg;
         
-        while( $elem =~ /^[+\!@#]/ ) {
+        while( $elem =~ /^[+\!@#-]/ ) {
           if( substr( $elem, 0, 1 ) eq '+' ) {
             $elem = substr( $elem, 1 );
             $compress = 1;
@@ -987,10 +988,18 @@ RSS: |-
             $elem = substr( $elem, 1 );
             $oneline = 1;
           }
+          if( substr( $elem, 0, 1 ) eq '-' ) {
+            $elem = substr( $elem, 1 );
+            $shorten = 0;
+          }
         }
         if( exists( $item->{ $elem } ) ) {
           if( $elem eq "link" ) {
-            push @bits, "<".makeashorterlink( $item->{ 'link' } ).">";
+            if( $shorten ) {
+              push @bits, "<".makeashorterlink( $item->{ 'link' } ).">";
+            } else {
+              push @bits, "<".$item->{ 'link' }.">";
+            }
           } else {
             my $tmp = $item->{ $elem };
             if( $strip == 1 ) {
@@ -1019,7 +1028,7 @@ RSS: |-
             push @bits, $tmp;
           }
         } else {
-               push @bits, $elem;
+          push @bits, $elem;
         }
       }
       push @items, join( ' ', @bits );