From a655150579c42ea76f411cc469ca8650592aace6 Mon Sep 17 00:00:00 2001 From: Will Budic Date: Tue, 21 May 2024 05:48:52 +1000 Subject: [PATCH] upd. layout and hdr fix for RSS. --- htdocs/cgi-bin/CNFServices.cgi | 11 ++++++----- htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm | 17 +++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/cgi-bin/CNFServices.cgi b/htdocs/cgi-bin/CNFServices.cgi index d9cb052..a67ccd6 100755 --- a/htdocs/cgi-bin/CNFServices.cgi +++ b/htdocs/cgi-bin/CNFServices.cgi @@ -34,7 +34,6 @@ use constant LOG_Settings => q( <<@<%LOG> file = web_server.log # Should it mirror to console too, in productation this must be zero, - # otherwise it will not output client. console = 0 # Disable/enable output to file at all? enabled = 1 @@ -167,12 +166,14 @@ of the Perl programming language through open discussion, collaboration, design, The Perl Foundation is a non-profit organization* based in Holland, Michigan~ #`Perl Weekly`https://perlweekly.com/perlweekly.rss` -`A free, once a week e-mail round-up of hand-picked news and articles about Perl. +7 busienss days` +A free, once a week e-mail round-up of hand-picked news and articles about Perl. The Perl Weekly ( http://perlweekly.com/ ) is a newsletter including links to blog posts and other news items related to the Perl programming language.~ #`The Cipher Brief RSS Feed`https://www.thecipherbrief.com/feed` -`The Cipher Brief is the go-to digital platform for the latest security news and high-level analysis. Each day, we offer multiple expert perspectives, engaging the private sector to find solutions and foster dialogue on what events mean for businesses and organizations around the world. More than just reporting on the news, The Cipher Brief helps readers understand what the news means to you.~ +7 busienss days` +The Cipher Brief is the go-to digital platform for the latest security news and high-level analysis. Each day, we offer multiple expert perspectives, engaging the private sector to find solutions and foster dialogue on what events mean for businesses and organizations around the world. More than just reporting on the news, The Cipher Brief helps readers understand what the news means to you.~ #`The Sydney Morning Herald - World RSS Feed`http://www.smh.com.au/rssheadlines/world/article/rss.xml` 1 business days` @@ -186,14 +187,14 @@ Lifehacker's is an award-winning daily blog that features tips, shortcuts, and d 3 business days` Your essential guide to what’s next, delivering the WIRED take on the intersection of technology, science, business, and culture.`~ -#`Viral Now`https://viralnow.uk/feed/`3 business days`ViralNow is a dynamic online platform at the forefront of curating and delivering trending and viral content. ViralNow brings you the latest and most engaging stories, videos, and articles from around the world.~ +#`Politico`https://rss.politico.com/politics-news.xml`2 business days`POLITICO strives to be the dominant source for news on politics and policy in power centers across every continent where access to reliable information, nonpartisan journ.lism and real-time tools create, inform and engage a global citizenry.~ >> <> __CNF_IS_COOL__ diff --git a/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm b/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm index 4aaa7aa..52030d4 100644 --- a/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm +++ b/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm @@ -51,6 +51,7 @@ sub process ($self, $parser, $property) { } my @header = @$ptr; my @data = @{$$table->{data}}; + #$parser->log("Header size:".scalar(@header) ); for my $idx (0 .. $#data){ my @col = @{$data[$idx]}; if($idx==0){ @@ -58,13 +59,13 @@ sub process ($self, $parser, $property) { if(@header){ my @lbls = CNFMeta::_deRefArray($header[0]); my @spec = CNFMeta::_deRefArray($header[3]); - $lbls[4] = $col[4]; - $spec[4] = $CNFMeta::CNF_DATA_TYPES{DATE}; + $lbls[5] = $col[5]; + $spec[5] = $CNFMeta::CNF_DATA_TYPES{DATE}; $$table->{header} = \[\@lbls,$header[1],$header[2],\@spec]; } }else{ $col[0] = $idx+1; - $col[4] = $self-> {date} -> toTimestamp(); + $col[5] = $self-> {date} -> toTimestamp(); } $data[$idx]=\@col; } @@ -74,7 +75,7 @@ sub process ($self, $parser, $property) { my @col = @{$data[$idx]}; $page .= qq|
  • $col[1] -   [ $col[4] ]
    $col[3]
  • \n|; +
    $col[4]
    Feed Refresh Rate: $col[3]
    \n|; } $page .= ''; $parser->data()->{PAGE} = \$page @@ -101,11 +102,11 @@ sub collectFeeds($self, $parser) { $ptr = $$table->{data}; my @data = @$ptr; my %hdr; - for(my $i=0;$i<@lbls;$i++){ #<- Column names are set here, if names in script are changed, They must be changed bellow. - $hdr{$lbls[$i]} = $i - } - $parser->log("Feed request:$feed data.size:" .scalar(@data)) if$feed; try{ + for(my $i=0;$i<@lbls;$i++){ #<- Column names are set here, if names in script are changed, They must be changed bellow. + $hdr{$lbls[$i]} = $i + } + $parser->log("Feed request:$feed data.size:" .scalar(@data)." hdr:".scalar(keys %hdr)) if$feed; for my $idx (0 .. $#data){ my @col = @{$data[$idx]}; #$parser->log("Feed spec: @col"); -- 2.34.1