- // if content is an image define as a preview too
- if (in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
- $entry->setPreviewPicture($content['url']);
+ if (!empty($content['all_headers'])) {
+ $entry->setHeaders($content['all_headers']);
+ }
+
+ $this->validateAndSetLanguage(
+ $entry,
+ isset($content['language']) ? $content['language'] : null
+ );
+
+ $this->validateAndSetPreviewPicture(
+ $entry,
+ isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : null
+ );
+
+ // if content is an image, define it as a preview too
+ if (!empty($content['content_type']) && in_array($this->mimeGuesser->guess($content['content_type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
+ $this->validateAndSetPreviewPicture(
+ $entry,
+ $content['url']
+ );
+ }
+
+ $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
+ $entry->setReadingTime(Utils::getReadingTime($html));
+
+ $domainName = parse_url($entry->getUrl(), PHP_URL_HOST);
+ if (false !== $domainName) {
+ $entry->setDomainName($domainName);