getFilteredContent() public method

Get filtered relevant content.
public getFilteredContent ( ) : string
return string
Beispiel #1
0
 /**
  * Fetch item content with the content grabber.
  *
  * @param Item $item Item object
  */
 public function scrapWebsite(Item $item)
 {
     if ($this->enable_grabber && !in_array($item->getUrl(), $this->grabber_ignore_urls)) {
         $grabber = new Scraper($this->config);
         $grabber->setUrl($item->getUrl());
         if ($this->grabber_needs_rule_file) {
             $grabber->disableCandidateParser();
         }
         $grabber->execute();
         if ($grabber->hasRelevantContent()) {
             $item->content = $grabber->getFilteredContent();
         }
     }
 }
Beispiel #2
0
function download_content_url($url)
{
    $content = '';
    $grabber = new Scraper(Config\get_reader_config());
    $grabber->setUrl($url);
    $grabber->execute();
    if ($grabber->hasRelevantContent()) {
        $content = $grabber->getFilteredContent();
    }
    return $content;
}