X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FWallabagRestController.php;h=349229f384524fd7c4bd03b6b13c52886ec48409;hb=8a60bc4cc2b6b1cfb5d8beb7ddcafc51d89a64c9;hp=d5579de4e18c4cb8fc06de4546898a67f29b96f9;hpb=fad316151c282b2383fae751f7ca45373f1f26ed;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index d5579de4..349229f3 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; -use Wallabag\CoreBundle\Service\Extractor; use Hateoas\Configuration\Route; use Hateoas\Representation\Factory\PagerfantaFactory; @@ -147,16 +146,10 @@ class WallabagRestController extends Controller { $url = $request->request->get('url'); - $content = $this->get('wallabag_core.graby')->fetchContent($url); - - $entry = new Entry($this->getUser()); - $entry->setUrl($url); - $entry->setTitle($request->request->get('title') ?: $content['title']); - $entry->setContent($content['html']); - $entry->setMimetype($content['content_type']); - if (isset($content['open_graph']['og_image'])) { - $entry->setPreviewPicture($content['open_graph']['og_image']); - } + $entry = $this->get('wallabag_core.content_proxy')->updateEntry( + new Entry($this->getUser()), + $url + ); $tags = $request->request->get('tags', ''); if (!empty($tags)) {