#!/usr/bin/perl use XML::RSSLite; use LWP::Simple; use strict; use warnings; # list of keywords we want my @keywords = qw(Testlink 4400); # get the RSS my $URL = 'xttp://datalux/rss.xml'; my $content = get($URL); # Parse the RSS my %result; parseRSS(\%result, \$content); # build the regex from keywords my $re = join "|", @keywords; $re = qr/\b(?:$re)\b/i; open TEMP, ">>list" or die "Konnte Datei nicht öffnen ($!)"; # print report of matching items foreach my $item (@{ $result{items} }) { my $title = $item->{title}; $title =~ s{\s+}{ }; $title =~ s{^\s+}{ }; $title =~ s{\s+$}{ }; if ($title =~ /$re/) { print "$title\n$item->{link}\n\n"; # Nur zum Test open READ_TEMP, ") { if ($_ = "$title\n$item->{link}\n\n") { #print "done\n"; # Nur zum Test } else { print TEMP "$title\n$item->{link}\n\n"; print "written\n"; } close READ_TEMP; } } } close TEMP;