diff --git a/composer.json b/composer.json index 2fef584..2b2e430 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "fguillot/simple-validator": "v1.0.0", "fguillot/json-rpc": "v1.0.2", "fguillot/picodb": "v1.0.2", - "fguillot/picofeed": "v0.1.10" + "fguillot/picofeed": "v0.1.11" }, "require-dev": { "phpunit/phpunit": "4.8.3", diff --git a/vendor/autoload.php b/vendor/autoload.php index 178beb2..895d8d2 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit26454215d679bdaf4be648601e93de89::getLoader(); +return ComposerAutoloaderInit6f38ac58c5736de0153f570459656edc::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 4040d8b..82bb8f1 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit26454215d679bdaf4be648601e93de89 +class ComposerAutoloaderInit6f38ac58c5736de0153f570459656edc { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit26454215d679bdaf4be648601e93de89 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit26454215d679bdaf4be648601e93de89', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit6f38ac58c5736de0153f570459656edc', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit26454215d679bdaf4be648601e93de89', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit6f38ac58c5736de0153f570459656edc', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ class ComposerAutoloaderInit26454215d679bdaf4be648601e93de89 $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire26454215d679bdaf4be648601e93de89($file); + composerRequire6f38ac58c5736de0153f570459656edc($file); } return $loader; } } -function composerRequire26454215d679bdaf4be648601e93de89($file) +function composerRequire6f38ac58c5736de0153f570459656edc($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index e2ca346..f68e063 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -37,55 +37,6 @@ "description": "Simple validator library", "homepage": "https://github.com/fguillot/simpleValidator" }, - { - "name": "fguillot/picofeed", - "version": "v0.1.10", - "version_normalized": "0.1.10.0", - "source": { - "type": "git", - "url": "https://github.com/fguillot/picoFeed.git", - "reference": "a2cc36244278afbfb9578037b1700ca3cd5a87d7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/a2cc36244278afbfb9578037b1700ca3cd5a87d7", - "reference": "a2cc36244278afbfb9578037b1700ca3cd5a87d7", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-iconv": "*", - "ext-libxml": "*", - "ext-simplexml": "*", - "ext-xml": "*", - "php": ">=5.3.0" - }, - "suggest": { - "ext-curl": "PicoFeed will use cURL if present" - }, - "time": "2015-09-12 11:05:28", - "bin": [ - "picofeed" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "PicoFeed": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frédéric Guillot" - } - ], - "description": "Modern library to handle RSS/Atom feeds", - "homepage": "https://github.com/fguillot/picoFeed" - }, { "name": "fguillot/json-rpc", "version": "v1.0.2", @@ -162,5 +113,54 @@ ], "description": "Minimalist database query builder", "homepage": "https://github.com/fguillot/picoDb" + }, + { + "name": "fguillot/picofeed", + "version": "v0.1.11", + "version_normalized": "0.1.11.0", + "source": { + "type": "git", + "url": "https://github.com/fguillot/picoFeed.git", + "reference": "14080ad7eef9f88744629d67a62da7c7b43d4e2c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/14080ad7eef9f88744629d67a62da7c7b43d4e2c", + "reference": "14080ad7eef9f88744629d67a62da7c7b43d4e2c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-xml": "*", + "php": ">=5.3.0" + }, + "suggest": { + "ext-curl": "PicoFeed will use cURL if present" + }, + "time": "2015-10-12 18:20:52", + "bin": [ + "picofeed" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "PicoFeed": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frédéric Guillot" + } + ], + "description": "Modern library to handle RSS/Atom feeds", + "homepage": "https://github.com/fguillot/picoFeed" } ] diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php index 36ab3f1..c380a46 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php @@ -88,9 +88,10 @@ class Html */ public function __construct($html, $website) { + $this->config = new Config; $this->input = XmlParser::HtmlToXml($html); $this->output = ''; - $this->tag = new Tag; + $this->tag = new Tag($this->config); $this->website = $website; $this->attribute = new Attribute(new Url($website)); } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php index b14ed94..6347054 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php @@ -3,7 +3,9 @@ namespace PicoFeed\Filter; use DOMXpath; + use PicoFeed\Parser\XmlParser; +use PicoFeed\Config\Config; /** * Tag Filter class @@ -13,6 +15,14 @@ use PicoFeed\Parser\XmlParser; */ class Tag { + /** + * Config object + * + * @access private + * @var \PicoFeed\Config\Config + */ + private $config; + /** * Tags blacklist (Xpath expressions) * @@ -71,6 +81,11 @@ class Tag 'q', ); + public function __construct(Config $config) + { + $this->config = $config; + } + /** * Check if the tag is allowed and is not a pixel tracker * @@ -130,7 +145,10 @@ class Tag */ public function isAllowedTag($tag) { - return in_array($tag, $this->tag_whitelist); + return in_array($tag, array_merge( + $this->tag_whitelist, + array_keys($this->config->getFilterWhitelistedTags(array())) + )); } /** diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.numerama.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.numerama.com.php index 1f75e4b..e3b50dc 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.numerama.com.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/www.numerama.com.php @@ -2,14 +2,14 @@ return array( 'grabber' => array( '%.*%' => array( - 'test_url' => 'http://www.numerama.com/magazine/26857-bientot-des-robots-dans-les-cuisines-de-mcdo.html', + 'test_url' => 'http://www.numerama.com/sciences/125959-recherches-ladn-recompensees-nobel-de-chimie.html', 'body' => array( - '//div[@class="col_left"]//div[@class="content"]', + '//article', ), 'strip' => array( - '//div[@class="news_social"]', - '//div[@id="newssuiv"]', + '//footer', + '//section[@class="related-article"]', ) ) ) -); \ No newline at end of file +);