webgui/sbin/Hourly/GetSyndicatedContent.pm
JT Smith fda03a0e63 - fix [ 1305132 ] 6.7.5 Assets are moved to trash by runHourly
- fix [ 1282473 ] RSS encoding (Thanks to Klaus Hertle)
2005-10-14 18:55:10 +00:00

34 lines
1.1 KiB
Perl

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 distinct SyndicatedContent.rssUrl from SyndicatedContent left join asset on SyndicatedContent.assetId=asset.assetId where asset.state='published'");
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;