publishedAt); $year = $splitted_timestamp[0]; $month = $splitted_timestamp[1]; $slug = $blog_post->slug; $uri = 'https://hytale.com/news/' . $year . '/' . $month . '/' . $slug; $item['uri'] = $uri; $item['title'] = $blog_post->title; $item['author'] = $blog_post->author; $item['timestamp'] = $blog_post->publishedAt; $blog_post_full = json_decode(getContents(self::_API_URL_BLOG_POST . $slug)); $item['content'] = $blog_post_full->body; $blog_cover_s3_key = $blog_post_full->coverImage->s3Key; $cover_images_urls = [ self::_BLOG_COVER_URL . $blog_cover_s3_key, self::_BLOG_THUMB_URL . $blog_cover_s3_key, ]; if (preg_match_all(self::_IMG_REGEX, $blog_post_full->body, $body_images_urls)) { $item['enclosures'] = array_merge($cover_images_urls, $body_images_urls[0]); } else { $item['enclosures'] = $cover_images_urls; } $this->items[] = $item; } } }