diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 3 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/ContentProxy.php | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 0930c109..cc2cca64 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -273,6 +273,9 @@ class EntryRestController extends WallabagRestController | |||
273 | /** | 273 | /** |
274 | * Create an entry. | 274 | * Create an entry. |
275 | * | 275 | * |
276 | * If you want to provide the HTML content (which means wallabag won't fetch it from the url), you must provide `content`, `title` & `url` fields **non-empty**. | ||
277 | * Otherwise, content will be fetched as normal from the url and values will be overwritten. | ||
278 | * | ||
276 | * @ApiDoc( | 279 | * @ApiDoc( |
277 | * parameters={ | 280 | * parameters={ |
278 | * {"name"="url", "dataType"="string", "required"=true, "format"="http://www.test.com/article.html", "description"="Url for the entry."}, | 281 | * {"name"="url", "dataType"="string", "required"=true, "format"="http://www.test.com/article.html", "description"="Url for the entry."}, |
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 66d72fe6..90d0c50d 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -31,7 +31,7 @@ class ContentProxy | |||
31 | } | 31 | } |
32 | 32 | ||
33 | /** | 33 | /** |
34 | * Fetch content using graby and hydrate given entry with results information. | 34 | * Fetch content using graby and hydrate given $entry with results information. |
35 | * In case we couldn't find content, we'll try to use Open Graph data. | 35 | * In case we couldn't find content, we'll try to use Open Graph data. |
36 | * | 36 | * |
37 | * We can also force the content, in case of an import from the v1 for example, so the function won't | 37 | * We can also force the content, in case of an import from the v1 for example, so the function won't |
@@ -39,7 +39,7 @@ class ContentProxy | |||
39 | * | 39 | * |
40 | * @param Entry $entry Entry to update | 40 | * @param Entry $entry Entry to update |
41 | * @param string $url Url to grab content for | 41 | * @param string $url Url to grab content for |
42 | * @param array $content An array with AT LEAST keys title, html, url, language & content_type to skip the fetchContent from the url | 42 | * @param array $content An array with AT LEAST keys title, html, url to skip the fetchContent from the url |
43 | * | 43 | * |
44 | * @return Entry | 44 | * @return Entry |
45 | */ | 45 | */ |
@@ -85,7 +85,7 @@ class ContentProxy | |||
85 | try { | 85 | try { |
86 | $entry->setPublishedAt(new \DateTime($content['date'])); | 86 | $entry->setPublishedAt(new \DateTime($content['date'])); |
87 | } catch (\Exception $e) { | 87 | } catch (\Exception $e) { |
88 | $this->logger->warn('Error while defining date', ['e' => $e, 'url' => $url, 'date' => $content['date']]); | 88 | $this->logger->warning('Error while defining date', ['e' => $e, 'url' => $url, 'date' => $content['date']]); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||