feat(indieblog) attempt to avoid duplicates and glitches
This commit is contained in:
parent
40378114ec
commit
be6825b3cb
@ -133,7 +133,13 @@ $channel->addChild('language', 'en');
|
|||||||
|
|
||||||
$newEntries = [];
|
$newEntries = [];
|
||||||
foreach ($groupedByDay as $day => $items) {
|
foreach ($groupedByDay as $day => $items) {
|
||||||
if (time() - strtotime($day) < 172800) {
|
if (time() - strtotime($day) < 172800) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (time() - strtotime($day) > 259200) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (count($items) < 10) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$rssItem = $channel->addChild('item');
|
$rssItem = $channel->addChild('item');
|
||||||
@ -168,4 +174,4 @@ function addCData(SimpleXMLElement $node, $content)
|
|||||||
$domNode = dom_import_simplexml($node);
|
$domNode = dom_import_simplexml($node);
|
||||||
$domOwner = $domNode->ownerDocument;
|
$domOwner = $domNode->ownerDocument;
|
||||||
$domNode->appendChild($domOwner->createCDATASection($content));
|
$domNode->appendChild($domOwner->createCDATASection($content));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user