get_items() as $item) { $post_datetime = Carbon::parse($item->get_date(\DateTime::ATOM)); if (! $post_datetime->isBetween(now()->subHours($hours), now())) { continue; } $title = trim($item->get_title()); $description = trim($item->get_content()); $domain = get_domain_from_url($item->get_link()); if (in_array($domain, $blacklist_rss_post_domain)) { continue; } $blacklist_rss_post_keywords = array_merge($blacklist_rss_post_keywords, get_country_names(true)); foreach ($blacklist_rss_post_keywords as $blacklist_keyword) { if (str_contains(strtolower($title), $blacklist_keyword)) { continue 2; } } $raw_posts[] = (object) [ 'source' => $f->get_title(), 'source_url' => $rss_url, 'title' => $title, 'link' => $item->get_link(), 'description' => $description, 'date' => $post_datetime, 'category' => $item->get_category()?->term, ]; } unset($f); return $raw_posts; } }