From da3d4998c0972557952c83b610f8f45fdcd31b72 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Mon, 28 Sep 2015 19:35:33 +0200 Subject: Move readingTime & domainName in ContentProxy So, everything is centralized in one place when we save a new entry. --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Wallabag/CoreBundle/Helper/ContentProxy.php') diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 3de8828f..7fb41393 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -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']); -- cgit v1.2.3