diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-12-22 09:16:08 +0100 |
commit | 5697f7c92cbc7b2c23d2a8c6ba3d904734dd0739 (patch) | |
tree | d9c7d8cf5b7a42d505ceb06d63a9e00fa212daf8 /vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php | |
parent | d2d16c4c26f8f9a7ee97350e5cba5c3554c51013 (diff) |
udpate picofeed
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php index 57661cb7b..1bca05664 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php @@ -3,7 +3,6 @@ namespace PicoFeed\Client; use DOMXPath; - use PicoFeed\Encoding\Encoding; use PicoFeed\Logging\Logger; use PicoFeed\Filter\Filter; @@ -148,7 +147,7 @@ class Grabber * * @access public * @param \PicoFeed\Config\Config $config Config instance - * @return \PicoFeed\Grabber + * @return Grabber */ public function setConfig($config) { @@ -179,6 +178,19 @@ class Grabber } /** + * Get filtered relevant content + * + * @access public + * @return string + */ + public function getFilteredContent() + { + $filter = Filter::html($this->content, $this->url); + $filter->setConfig($this->config); + return $filter->execute(); + } + + /** * Parse the HTML content * * @access public @@ -191,8 +203,8 @@ class Grabber Logger::setMessage(get_called_class().' Fix encoding'); Logger::setMessage(get_called_class().': HTTP Encoding "'.$this->encoding.'"'); - $this->html = Filter::stripHeadTags($this->html); $this->html = Encoding::convert($this->html, $this->encoding); + $this->html = Filter::stripHeadTags($this->html); Logger::setMessage(get_called_class().' Content length: '.strlen($this->html).' bytes'); $rules = $this->getRules(); @@ -228,6 +240,7 @@ class Grabber $client->setConfig($this->config); $client->execute($this->url); + $this->url = $client->getUrl(); $this->html = $client->getContent(); $this->encoding = $client->getEncoding(); |