]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Integrate graby
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index a77489e250cf0c6b2a9f9bd1d68e291cf6b110e0..bd87c6f4431ff88a702d58e3cedbdade7c866adb 100644 (file)
@@ -31,10 +31,14 @@ class EntryController extends Controller
         $form->handleRequest($request);
 
         if ($form->isValid()) {
-            $content = Extractor::extract($entry->getUrl());
-
-            $entry->setTitle($content->getTitle());
-            $entry->setContent($content->getBody());
+            $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl());
+
+            $entry->setTitle($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']);
+            }
 
             $em = $this->getDoctrine()->getManager();
             $em->persist($entry);