miniflux-legacy/app/handlers/scraper.php

22 lines
393 B
PHP
Raw Normal View History

2016-08-19 04:33:58 +02:00
<?php
2016-08-25 03:17:58 +02:00
namespace Miniflux\Handler\Scraper;
2016-08-19 04:33:58 +02:00
use PicoFeed\Scraper\Scraper;
use Miniflux\Handler;
2016-08-19 04:33:58 +02:00
function download_content($url)
2016-08-19 04:33:58 +02:00
{
$contents = '';
$scraper = new Scraper(Handler\Feed\get_reader_config());
2016-08-19 04:33:58 +02:00
$scraper->setUrl($url);
$scraper->execute();
if ($scraper->hasRelevantContent()) {
$contents = $scraper->getFilteredContent();
}
return $contents;
}