diff --git a/blankRSS.pl b/blankRSS.pl index 0782dde..4ce6c0e 100755 --- a/blankRSS.pl +++ b/blankRSS.pl @@ -21,6 +21,7 @@ use warnings; # Packages use Time::Piece; # https://perldoc.perl.org/Time::Piece +use Time::Seconds; # https://perldoc.perl.org/Time::Seconds use LWP::Simple; # https://metacpan.org/pod/LWP::Simple use XML::RSS; # https://metacpan.org/pod/XML::RSS use HTML::Entities; # https://metacpan.org/pod/HTML::Entities @@ -52,9 +53,12 @@ my $copyright = 'Copyright respective writers'; # add to new RSS feed object ################################### +# number of weeks in the past to hold RSS feed +my $num_weeks = 2; + # get today, subtact time to make cut off my $now = localtime; -my $then = $now->add_months(-2); +my $then = $now - (ONE_WEEK * $num_weeks); #number of items to keep from each feed my $number_of_items = 2; # +1 since everything starts at 0 @@ -146,7 +150,7 @@ while ( my $url = ) { } # while DATA #close out the list URL html -$listHTML .= "\n"; +$listHTML .= "\n"; ################################### # Write the error file @@ -185,7 +189,7 @@ foreach my $name (reverse sort keys %list) { link => $list{$name}->{'link'}, description => $list{$name}->{'description'}, pubDate => $list{$name}->{'pubDate'}, - author => $list{$name}->{'dc'}{'creator'}, + author => $list{$name}->{'itemAuthor'}, source => $list{$name}->{'feedName'}, sourceUrl => $list{$name}->{'feedURL'}, ); # $rss->channel