updated blank with changes from smhn
This commit is contained in:
parent
e8b01b292c
commit
5e393fd674
10
blankRSS.pl
10
blankRSS.pl
@ -21,6 +21,7 @@ use warnings;
|
|||||||
# Packages
|
# Packages
|
||||||
|
|
||||||
use Time::Piece; # https://perldoc.perl.org/Time::Piece
|
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 LWP::Simple; # https://metacpan.org/pod/LWP::Simple
|
||||||
use XML::RSS; # https://metacpan.org/pod/XML::RSS
|
use XML::RSS; # https://metacpan.org/pod/XML::RSS
|
||||||
use HTML::Entities; # https://metacpan.org/pod/HTML::Entities
|
use HTML::Entities; # https://metacpan.org/pod/HTML::Entities
|
||||||
@ -52,9 +53,12 @@ my $copyright = 'Copyright respective writers';
|
|||||||
# add to new RSS feed object
|
# 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
|
# get today, subtact time to make cut off
|
||||||
my $now = localtime;
|
my $now = localtime;
|
||||||
my $then = $now->add_months(-2);
|
my $then = $now - (ONE_WEEK * $num_weeks);
|
||||||
|
|
||||||
#number of items to keep from each feed
|
#number of items to keep from each feed
|
||||||
my $number_of_items = 2; # +1 since everything starts at 0
|
my $number_of_items = 2; # +1 since everything starts at 0
|
||||||
@ -146,7 +150,7 @@ while ( my $url = <DATA>) {
|
|||||||
} # while DATA
|
} # while DATA
|
||||||
|
|
||||||
#close out the list URL html
|
#close out the list URL html
|
||||||
$listHTML .= "</div></ul>\n";
|
$listHTML .= "</ul></div>\n";
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Write the error file
|
# Write the error file
|
||||||
@ -185,7 +189,7 @@ foreach my $name (reverse sort keys %list) {
|
|||||||
link => $list{$name}->{'link'},
|
link => $list{$name}->{'link'},
|
||||||
description => $list{$name}->{'description'},
|
description => $list{$name}->{'description'},
|
||||||
pubDate => $list{$name}->{'pubDate'},
|
pubDate => $list{$name}->{'pubDate'},
|
||||||
author => $list{$name}->{'dc'}{'creator'},
|
author => $list{$name}->{'itemAuthor'},
|
||||||
source => $list{$name}->{'feedName'},
|
source => $list{$name}->{'feedName'},
|
||||||
sourceUrl => $list{$name}->{'feedURL'},
|
sourceUrl => $list{$name}->{'feedURL'},
|
||||||
); # $rss->channel
|
); # $rss->channel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user