From 0146e96fcffe01350f8778335a9815177f6f7b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 26 May 2014 18:49:52 -0400 Subject: [PATCH] Update grabber rule for igen.fr --- vendor/PicoFeed/Grabber.php | 4 ++++ vendor/PicoFeed/Reader.php | 4 ++-- vendor/PicoFeed/Rules/.igen.fr.php | 4 ++-- vendor/PicoFeed/Rules/macg.co.php | 9 +++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 vendor/PicoFeed/Rules/macg.co.php diff --git a/vendor/PicoFeed/Grabber.php b/vendor/PicoFeed/Grabber.php index d2ce0c8..840d11d 100644 --- a/vendor/PicoFeed/Grabber.php +++ b/vendor/PicoFeed/Grabber.php @@ -261,9 +261,12 @@ class Grabber if (($pos = strpos($hostname, '.')) !== false) { $files[] = substr($hostname, $pos); + $files[] = substr($hostname, $pos + 1); $files[] = substr($hostname, 0, $pos); } + // Logging::setMessage(var_export($files, true)); + foreach ($files as $file) { $filename = __DIR__.'/Rules/'.$file.'.php'; @@ -285,6 +288,7 @@ class Grabber */ public function parseContentWithRules(array $rules) { + // Logging::setMessage($this->html); $dom = XmlParser::getHtmlDocument(''.$this->html); $xpath = new DOMXPath($dom); diff --git a/vendor/PicoFeed/Reader.php b/vendor/PicoFeed/Reader.php index acee7d0..0c65603 100644 --- a/vendor/PicoFeed/Reader.php +++ b/vendor/PicoFeed/Reader.php @@ -235,8 +235,8 @@ class Reader $xpath = new DOMXPath($dom); $queries = array( - "//link[@type='application/atom+xml']", - "//link[@type='application/rss+xml']" + '//link[@type="application/rss+xml"]', + '//link[@type="application/atom+xml"]', ); foreach ($queries as $query) { diff --git a/vendor/PicoFeed/Rules/.igen.fr.php b/vendor/PicoFeed/Rules/.igen.fr.php index b0a99ef..0e0436e 100644 --- a/vendor/PicoFeed/Rules/.igen.fr.php +++ b/vendor/PicoFeed/Rules/.igen.fr.php @@ -1,8 +1,8 @@ 'http://www.igen.fr/iphone/ios-7-cree-des-milliers-de-requetes-fantomes-sur-le-web-110130', + 'test_url' => 'http://www.igen.fr/ailleurs/2014/05/nvidia-va-delaisser-les-smartphones-grand-public-86031', 'body' => array( - '//*[starts-with(@id, "news")]/*[contains(@class, "content")]' + '//div[contains(@class, "field-name-body")]' ), 'strip' => array( ), diff --git a/vendor/PicoFeed/Rules/macg.co.php b/vendor/PicoFeed/Rules/macg.co.php new file mode 100644 index 0000000..ae54540 --- /dev/null +++ b/vendor/PicoFeed/Rules/macg.co.php @@ -0,0 +1,9 @@ + 'http://www.macg.co//logiciels/2014/05/feedly-sameliore-un-petit-peu-sur-mac-82205', + 'body' => array( + '//div[contains(@class, "field-name-body")]' + ), + 'strip' => array( + ), +); \ No newline at end of file