miniflux-legacy/app/handlers/scraper.php
2016-08-18 22:33:58 -04:00

22 lines
375 B
PHP

<?php
namespace Handler\Scraper;
use PicoFeed\Scraper\Scraper;
use Model\Config;
function download_contents($url)
{
$contents = '';
$scraper = new Scraper(Config\get_reader_config());
$scraper->setUrl($url);
$scraper->execute();
if ($scraper->hasRelevantContent()) {
$contents = $scraper->getFilteredContent();
}
return $contents;
}