feat(indieblog) attempt to avoid duplicates and glitches

This commit is contained in:
SansGuidon 2025-02-26 00:50:25 +00:00
parent 40378114ec
commit be6825b3cb

View File

@ -133,7 +133,13 @@ $channel->addChild('language', 'en');
$newEntries = [];
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;
}
$rssItem = $channel->addChild('item');
@ -168,4 +174,4 @@ function addCData(SimpleXMLElement $node, $content)
$domNode = dom_import_simplexml($node);
$domOwner = $domNode->ownerDocument;
$domNode->appendChild($domOwner->createCDATASection($content));
}
}