aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-08-24 12:27:17 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-08-24 12:27:17 +0200
commitfad316151c282b2383fae751f7ca45373f1f26ed (patch)
treeef024e9a523d9dd2fa322161bab12ad4472bb272 /src/Wallabag/CoreBundle/Controller
parent8c55a9e6c9a563c3a4b3b3d35581e1c67a8a8c04 (diff)
downloadwallabag-fad316151c282b2383fae751f7ca45373f1f26ed.tar.gz
wallabag-fad316151c282b2383fae751f7ca45373f1f26ed.tar.zst
wallabag-fad316151c282b2383fae751f7ca45373f1f26ed.zip
Integrate graby
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index a77489e2..bd87c6f4 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -31,10 +31,14 @@ class EntryController extends Controller
31 $form->handleRequest($request); 31 $form->handleRequest($request);
32 32
33 if ($form->isValid()) { 33 if ($form->isValid()) {
34 $content = Extractor::extract($entry->getUrl()); 34 $content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl());
35 35
36 $entry->setTitle($content->getTitle()); 36 $entry->setTitle($content['title']);
37 $entry->setContent($content->getBody()); 37 $entry->setContent($content['html']);
38 $entry->setMimetype($content['content_type']);
39 if (isset($content['open_graph']['og_image'])) {
40 $entry->setPreviewPicture($content['open_graph']['og_image']);
41 }
38 42
39 $em = $this->getDoctrine()->getManager(); 43 $em = $this->getDoctrine()->getManager();
40 $em->persist($entry); 44 $em->persist($entry);