Example #1
0
    public function testGrabContent()
    {
        $grabber = new Grabber('http://www.egscomics.com/index.php?id=1690');
        $grabber->download();
        $this->assertTrue($grabber->parse());

        $this->assertEquals('<img title="2013-08-22" src="comics/../comics/1377151029-2013-08-22.png" id="comic" border="0" />', $grabber->getContent());
    }
Example #2
0
 /**
  * Fetch item content with the content grabber
  *
  * @access public
  * @param  Item    $item          Item object
  */
 public function scrapWebsite(Item $item)
 {
     if ($this->enable_grabber && !in_array($item->getUrl(), $this->grabber_ignore_urls)) {
         $grabber = new Grabber($item->getUrl());
         $grabber->setConfig($this->config);
         $grabber->download();
         if ($grabber->parse()) {
             $item->content = $grabber->getFilteredContent();
         }
     }
 }
Example #3
0
function download_content_url($url)
{
    $content = '';
    $grabber = new Grabber($url);
    $grabber->setConfig(Config\get_reader_config());
    $grabber->download();
    if ($grabber->parse()) {
        $content = $grabber->getFilteredcontent();
    }
    return $content;
}