From 5e9009ce86a366001616fad5b28cb59dc20ee4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 5 Apr 2017 22:22:16 +0200 Subject: Added publication date --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 4 ++++ 1 file changed, 4 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 f222dd88..56358665 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -79,6 +79,10 @@ class ContentProxy $entry->setContent($html); $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); + if (isset($content['date']) && null !== $content['date']) { + $entry->setPublishedAt(new \DateTime($content['date'])); + } + $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); $entry->setReadingTime(Utils::getReadingTime($html)); -- cgit v1.2.3 From 7b0b3622ab2dd909028481b294c91f88a5682671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 6 Apr 2017 09:36:20 +0200 Subject: Added author of article --- src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (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 56358665..d45aef88 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -79,10 +79,14 @@ class ContentProxy $entry->setContent($html); $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); - if (isset($content['date']) && null !== $content['date']) { + if (isset($content['date']) && null !== $content['date'] && '' !== $content['date']) { $entry->setPublishedAt(new \DateTime($content['date'])); } + if (!empty($content['authors'])) { + $entry->setPublishedBy($content['authors']); + } + $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); $entry->setReadingTime(Utils::getReadingTime($html)); -- cgit v1.2.3