mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-12 16:58:37 +00:00
Integrate graby
This commit is contained in:
parent
8c55a9e6c9
commit
fad316151c
10 changed files with 58 additions and 180 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue