From: Will Budic Date: Mon, 20 May 2024 12:54:08 +0000 (+1000) Subject: Fix. merged new working tree with development. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=e6e115a8e91c6b267d237083f4bee06ea0e3bea1;p=LifeLog.git Fix. merged new working tree with development. --- diff --git a/htdocs/cgi-bin/CNFServices.cgi b/htdocs/cgi-bin/CNFServices.cgi index 824c493..d9cb052 100755 --- a/htdocs/cgi-bin/CNFServices.cgi +++ b/htdocs/cgi-bin/CNFServices.cgi @@ -151,8 +151,10 @@ LOG_Settings . <<__CNF_IS_COOL__; >> // Following is a table having a list of details for available RSS feeds to process. -|| The more rows have here the longer it takes to fetch them, what is it, once a day, week, month? -<< RSS_FEEDS __CONST__ +|| The more rows we have here the longer it takes to fetch them, what is it, once a day, week, month? +|| The _CONST_ meta makes the property a CNF constant just in case. +|| The _HAS_HEADER_ meta makes it compatible with the new and old parser. +<< RSS_FEEDS __CONST__ _HAS_HEADER_ ID`Name`URL`Expires`Description~ #`CPAN`http://search.cpan.org/uploads.rdf` diff --git a/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm b/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm index c026c2d..4aaa7aa 100644 --- a/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm +++ b/htdocs/cgi-bin/system/modules/RSSFeedsPlugin.pm @@ -50,7 +50,7 @@ sub process ($self, $parser, $property) { $ptr = $$ptr; } my @header = @$ptr; - my @data = CNFMeta::_deRefArray($$table->{data}); + my @data = @{$$table->{data}}; for my $idx (0 .. $#data){ my @col = @{$data[$idx]}; if($idx==0){ @@ -95,20 +95,23 @@ sub collectFeeds($self, $parser) { } my $page; my @header = @$ptr; - my @data = @{$$table->{data}}; my $cgi = $parser->const('CGI'); my $feed = $cgi->param('feed') if $cgi; my @lbls = CNFMeta::_deRefArray($header[0]); + $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") if$feed; + $parser->log("Feed request:$feed data.size:" .scalar(@data)) if$feed; + try{ for my $idx (0 .. $#data){ my @col = @{$data[$idx]}; + #$parser->log("Feed spec: @col"); my $name = $col[$hdr{Name}]; next if($feed && $feed ne $name); - my $tree = fetchFeed($self, $name, $col[$hdr{URL}], $col[$hdr{Description}]); + my $tree = fetchFeed($self, $name, $col[$hdr{URL}], $col[$hdr{Expires}], $col[$hdr{Description}]); $parser->log("Fetched feed:".$name); if($tree && ref($$tree) eq 'CNFNode'){ if(not isCNFTrue($self->{CNF_TREE_LOADED}) && isCNFTrue($self->{CNF_TREE_STORE})){ @@ -130,6 +133,9 @@ sub collectFeeds($self, $parser) { $parser-> warn("Feed '$name' bailed to return a CNFNode tree.") } } + }catch{ + $parser-> error("RSSFeedsPlugin\@collectFeeds() Error:$@") + } $parser->data()->{PAGE} = \$page if $page; } ### PerlCNF TREE to HTML Conversion Routine, XML based RSS of various Internet feeds convert to PerlCNF previously.