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()); }
/** * 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(); } } }
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; }