1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-12 16:58:37 +00:00

Integrate graby

This commit is contained in:
Jeremy Benoist 2015-08-24 12:27:17 +02:00
parent 8c55a9e6c9
commit fad316151c
10 changed files with 58 additions and 180 deletions

View file

@ -31,10 +31,14 @@ class EntryController extends Controller
$form->handleRequest($request);
if ($form->isValid()) {
$content = Extractor::extract($entry->getUrl());
$content = $this->get('wallabag_core.graby')->fetchContent($entry->getUrl());
$entry->setTitle($content->getTitle());
$entry->setContent($content->getBody());
$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);