RSS Grep

Here is a simple RSS news grep for your menu.
http://djamo.gotdns.com/?p=Scripts&s=rss.pl

Make sure to add this to your menu config,
(I have more scripts on my site)

DestroyFunc Rss
AddToFunc Rss
+ I DestroyMenu recreate Rss
+ I AddToMenu Rss
+ I PipeRead '~/.fvwm/scripts/rss.pl http://slashdot.org/slashdot.rss firefox'
AddToMenu Rss
+ DynamicPopupAction Function Rss

[color=red]Edited by theBlackDragon:
–> Moved to Other scripting languages from General configuration questions[/color]

where do we get the rss.pl part from?

[edit]
Answer, from the link posted above.

Note to self, not to post before drinking first cup of coffee in the morning.

I have to put the command perl after the piperead, is that normal or did i forgot a configuration setting?

DestroyFunc Rss
AddToFunc Rss
+ I DestroyMenu recreate Rss
+ I AddToMenu Rss
+ I PipeRead 'perl $[fvwm_home]/scripts/rss.pl http://slashdot.org/slashdot.rss firefox'
AddToMenu Rss
+ DynamicPopupAction Function Rss

It should run by itself. but there are a few things that need to be true for that to happen

The script needs to be in directory listed in $PATH

the script needs to have the executable bit set with chmod +x

the path to the perl executable on the first line of the script needs to be correct for your system.

If all those are correct it should run from the command line without the perl. If it does that, then you can put it into the config with a fair degree of confidence

I suppose the way to make that more generic is to use:

#!/usr/bin/env perl

With the caveat that any command-line switches you had after it be converted to perk’s use syntax, as in:

use warnings;

for instance.

– Thomas Adam

he… he… he… i sort of… uhm borked my drive & lost everything, could someone post the script in this thread? :slight_smile:

#!/usr/bin/perl
#== #DJAMORPHEUS#============================
#== This Script Parses rss files ============
#== and adds entries to your menu ===========
#== Usage: rss.pl  
#===========================================
#use warnings;
#use strict;
use LWP::Simple;
use XML::RSS;

my $rss = new XML::RSS();
my $content= get("$ARGV[0]");
die "Couldn't get Content.\n" unless defined $content;
my $www = $ARGV[1];
die "Set Browser!\n" unless defined $www;
#Parse RSS
$rss->parse($content);

#RSS Variables
my $title = $rss->channel('title');
my @title = split( /:/, $title);
print qq|+ "$title[0]" Title\n|;
foreach my $item (@{$rss->{'items'}}) {
        my $i_title= $item->{'title'};
        my $url = $item->{'link'};
        print qq|+ "$i_title" Exec exec $www $url\n|;
}