From: pdbogen Date: Mon, 1 Jun 2009 20:55:16 +0000 (+0000) Subject: Tweak RSS a bit, so that we can choose not to shorten URLs if they're already shorten... X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=26a777e628c6c34a8127e802b08b27218f07718a;p=destult.git Tweak RSS a bit, so that we can choose not to shorten URLs if they're already shortened. And change a tab back to spaces. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@96 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/commands.yaml b/commands.yaml index d158ef4..4d49136 100644 --- a/commands.yaml +++ b/commands.yaml @@ -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 );