mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Integrate graby
This commit is contained in:
parent
8c55a9e6c9
commit
fad316151c
10 changed files with 58 additions and 180 deletions
|
@ -147,11 +147,16 @@ class WallabagRestController extends Controller
|
|||
{
|
||||
$url = $request->request->get('url');
|
||||
|
||||
$content = Extractor::extract($url);
|
||||
$content = $this->get('wallabag_core.graby')->fetchContent($url);
|
||||
|
||||
$entry = new Entry($this->getUser());
|
||||
$entry->setUrl($url);
|
||||
$entry->setTitle($request->request->get('title') ?: $content->getTitle());
|
||||
$entry->setContent($content->getBody());
|
||||
$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']);
|
||||
}
|
||||
|
||||
$tags = $request->request->get('tags', '');
|
||||
if (!empty($tags)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue