]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Helper/ContentProxy.php
Move readingTime & domainName in ContentProxy
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Helper / ContentProxy.php
index 3de8828f98e1e5740a155d60532d45c875010836..7fb41393127c8bcdaab1a11511a988e93bb6cb16 100644 (file)
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Helper;
 
 use Graby\Graby;
 use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Tools\Utils;
 
 /**
  * This kind of proxy class take care of getting the content from an url
@@ -51,6 +52,8 @@ class ContentProxy
         $entry->setContent($html);
         $entry->setLanguage($content['language']);
         $entry->setMimetype($content['content_type']);
+        $entry->setReadingTime(Utils::getReadingTime($html));
+        $entry->setDomainName(parse_url($entry->getUrl(), PHP_URL_HOST));
 
         if (isset($content['open_graph']['og_image'])) {
             $entry->setPreviewPicture($content['open_graph']['og_image']);