diff options
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r-- | inc/poche/Poche.class.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index a8a54ff0..5862befb 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -332,9 +332,12 @@ class Poche | |||
332 | switch ($action) | 332 | switch ($action) |
333 | { | 333 | { |
334 | case 'add': | 334 | case 'add': |
335 | $content = $url->extract(); | 335 | $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed'); |
336 | $content = json_decode($json, true); | ||
337 | $title = $content['rss']['channel']['item']['title']; | ||
338 | $body = $content['rss']['channel']['item']['description']; | ||
336 | 339 | ||
337 | if ($this->store->add($url->getUrl(), $content['title'], $content['body'], $this->user->getId())) { | 340 | if ($this->store->add($url->getUrl(), $title, $body, $this->user->getId())) { |
338 | Tools::logm('add link ' . $url->getUrl()); | 341 | Tools::logm('add link ' . $url->getUrl()); |
339 | $sequence = ''; | 342 | $sequence = ''; |
340 | if (STORAGE == 'postgres') { | 343 | if (STORAGE == 'postgres') { |
@@ -342,7 +345,7 @@ class Poche | |||
342 | } | 345 | } |
343 | $last_id = $this->store->getLastId($sequence); | 346 | $last_id = $this->store->getLastId($sequence); |
344 | if (DOWNLOAD_PICTURES) { | 347 | if (DOWNLOAD_PICTURES) { |
345 | $content = filtre_picture($content['body'], $url->getUrl(), $last_id); | 348 | $content = filtre_picture($body, $url->getUrl(), $last_id); |
346 | Tools::logm('updating content article'); | 349 | Tools::logm('updating content article'); |
347 | $this->store->updateContent($last_id, $content, $this->user->getId()); | 350 | $this->store->updateContent($last_id, $content, $this->user->getId()); |
348 | } | 351 | } |