find('article'); $itemCount = 0; $maxItems = 10; // Limit to first page (approximately 10 items) foreach ($articles as $article) { if ($itemCount >= $maxItems) { break; } $item = []; // Extract title and link from header $header = $article->find('.entry-header', 0); if ($header) { $titleLink = $header->find('h2 a', 0); if ($titleLink) { $item['title'] = trim($titleLink->plaintext); $item['uri'] = $titleLink->href; $item['uid'] = $titleLink->href; } } // Extract content from entry-content div $contentDiv = $article->find('.entry-content', 0); if ($contentDiv) { // Get the full HTML content including images $item['content'] = $contentDiv->innertext; } // Extract date and author from footer $footer = $article->find('.entry-footer', 0); if ($footer) { // Extract date from time element $timeElement = $footer->find('time.entry-date', 0); if ($timeElement && $timeElement->datetime) { $timestamp = strtotime($timeElement->datetime); if ($timestamp !== false) { $item['timestamp'] = $timestamp; } } // Extract author $authorLink = $footer->find('.author a', 0); if ($authorLink) { $item['author'] = trim($authorLink->plaintext); } } // Only add item if we have at least title and content if (!empty($item['title']) && !empty($item['content'])) { $this->items[] = $item; $itemCount++; } } } }