How to add an RSS feed to Conky/simple-rss-reader.pl

Perl script to be used with Conky. The script displays a simple RSS feed, titles only.




 * 1) !/usr/bin/perl -w


 * 1) Creator: Jeff Israel
 * 2) Script:	./simple-rss-reader-v3.pl
 * 3) Version: 	3.001
 * 4) Coded for for Wikihowto http://howto.wikia.com
 * 5) Description: 	This code downloads an RSS feed,
 * 6) 		extracts the lines,
 * 7) 		cleans them up lines,
 * 8) 		prints the pretty lines
 * 9) 		exits on max-lines
 * 10) Usage:
 * 11) .conkyrc: ${execi [time] /path/to/script/simple-rss-reader-v3.pl}
 * 12) Usage Example
 * 13) ${execi 300 /path/to/script/simple-rss-reader-v3.pl}
 * 1) Usage:
 * 2) .conkyrc: ${execi [time] /path/to/script/simple-rss-reader-v3.pl}
 * 3) Usage Example
 * 4) ${execi 300 /path/to/script/simple-rss-reader-v3.pl}
 * 1) ${execi 300 /path/to/script/simple-rss-reader-v3.pl}

use LWP::Simple;


 * 1) Configs
 * 1) Configs

$rssPage = "http://tvrss.net/feed/eztv/"; $numLines = 10; $maxTitleLenght = 35;
 * 1) $rssPage = "http://tvrss.net/feed/combined/";


 * 1) Code
 * 1) Code

my $pageCont = get($rssPage);
 * 1) Downloading RSS feed

@pageLines = split(/\n/,$pageCont);
 * 1) Spliting the page to lines

$numLines--; #correcting count for loop $x = 0; foreach $line (@pageLines) { if($line =~ /\/){ # Is a good line? #print "- $line\n"; $lineCat = $line; $lineCat =~ s/.*\//; $lineCat =~ s/\<\/title\>.*//; $lineCat =~ s/\[.{4,25}\]$//; # strip no-fun data ( [from blaaa] ) $lineCat = substr($lineCat, 0, $maxTitleLenght); print "- $lineCat \n"; $x++; }	if($x > $numLines) { last; #exit on max-lines } }
 * 1) Parse each line, strip no-fun data, exit on max-lines


 * 1) print $page;
 * 2) print "\nBy Bye\n";