Significant update to the SyndicatedContent wobject to allow for better aggregation and scheduled content downloads.
This commit is contained in:
parent
c7c968eaf2
commit
2fd3cb57f3
6 changed files with 519 additions and 150 deletions
34
sbin/Hourly/GetSyndicatedContent.pm
Normal file
34
sbin/Hourly/GetSyndicatedContent.pm
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package Hourly::GetSyndicatedContent;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use WebGUI::SQL;
|
||||
use WebGUI::Asset::Wobject::SyndicatedContent;
|
||||
|
||||
=head2 Hourly::GetSyndicatedContent
|
||||
|
||||
Loops through all the URLs in the SyndicatedWobjects and puts them into WebGUI::Cache if they haven't been spidered or if they have expired from the cache. This should reduce HTTP traffic a little, and allow for more granular scheduling of feed downloads in the future.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
sub process{
|
||||
|
||||
#In the new Wobject, "rssURL" actually can refer to more than one URL.
|
||||
my @syndicatedWobjectURLs = WebGUI::SQL->buildArray("select rssUrl from SyndicatedContent");
|
||||
foreach my $url(@syndicatedWobjectURLs) {
|
||||
|
||||
#Loop through the SyndicatedWobjects and split all the URLs they are syndicating off into
|
||||
#a separate array.
|
||||
|
||||
my @urlsToSyndicate = split(/\s+/,$url);
|
||||
foreach ((@urlsToSyndicate)) {
|
||||
WebGUI::Asset::Wobject::SyndicatedContent::_get_rss_data($_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
Loading…
Add table
Add a link
Reference in a new issue