find('a.single-post-archive') as $element) { if(count($this->items) >= 10) { break; } $article_title = trim(strip_tags($element->find('div.post-name span', 0)->innertext)); $article_uri = $element->href; $article_content = ''; if ($element->find('div.excerpt', 0)) { $article_content = trim(strip_tags($element->find('div.excerpt', 0)->innertext)); } $article_date = ''; if ($element->find('span.post-date', 0)) { $article_date = $element->find('span.post-date', 0)->innertext; } $article_author = ''; if ($element->find('span.author-name', 0)) { $article_author = $element->find('span.author-name', 0)->innertext; } $article_uid = $article_title; // Store article in items array if (!empty($article_title)) { $item = array(); $item['uri'] = $article_uri; $item['title'] = $article_title; $item['content'] = $article_content; $item['uid'] = $article_uid; if (!empty($article_date)) { $item['timestamp'] = strtotime($article_date); } if (!empty($article_author)) { $item['author'] = $article_author; } $this->items[] = $item; } } } }