Add new content grabber rules
This commit is contained in:
parent
33ab9d7fb6
commit
2486498d67
9
vendor/PicoFeed/Filter.php
vendored
9
vendor/PicoFeed/Filter.php
vendored
@ -152,10 +152,11 @@ class Filter
|
|||||||
|
|
||||||
// Iframe source whitelist, everything else is ignored
|
// Iframe source whitelist, everything else is ignored
|
||||||
public static $iframe_whitelist = array(
|
public static $iframe_whitelist = array(
|
||||||
'http://www.youtube.com/',
|
'//www.youtube.com',
|
||||||
'https://www.youtube.com/',
|
'http://www.youtube.com',
|
||||||
'http://player.vimeo.com/',
|
'https://www.youtube.com',
|
||||||
'https://player.vimeo.com/',
|
'http://player.vimeo.com',
|
||||||
|
'https://player.vimeo.com',
|
||||||
'http://www.dailymotion.com',
|
'http://www.dailymotion.com',
|
||||||
'https://www.dailymotion.com',
|
'https://www.dailymotion.com',
|
||||||
);
|
);
|
||||||
|
3
vendor/PicoFeed/Grabber.php
vendored
3
vendor/PicoFeed/Grabber.php
vendored
@ -92,7 +92,7 @@ class Grabber
|
|||||||
$this->html = Encoding::toUTF8($this->html);
|
$this->html = Encoding::toUTF8($this->html);
|
||||||
}
|
}
|
||||||
|
|
||||||
Logging::log(\get_called_class().' Try to find rules');
|
Logging::log(\get_called_class().' Content length: '.strlen($this->html).' bytes');
|
||||||
$rules = $this->getRules();
|
$rules = $this->getRules();
|
||||||
|
|
||||||
if (is_array($rules)) {
|
if (is_array($rules)) {
|
||||||
@ -147,6 +147,7 @@ class Grabber
|
|||||||
$filename = __DIR__.'/Rules/'.$file.'.php';
|
$filename = __DIR__.'/Rules/'.$file.'.php';
|
||||||
|
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
|
Logging::log(\get_called_class().' Load rule: '.$file);
|
||||||
return include $filename;
|
return include $filename;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
11
vendor/PicoFeed/Rules/.igen.fr.php
vendored
Normal file
11
vendor/PicoFeed/Rules/.igen.fr.php
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'test_url' => 'http://www.igen.fr/iphone/ios-7-cree-des-milliers-de-requetes-fantomes-sur-le-web-110130',
|
||||||
|
'body' => array(
|
||||||
|
'//div[contains(@id, "news")]',
|
||||||
|
),
|
||||||
|
'strip' => array(
|
||||||
|
'//*[contains(@class, "submitted")]',
|
||||||
|
'//*[contains(@class, "clear-block")]',
|
||||||
|
),
|
||||||
|
);
|
9
vendor/PicoFeed/Rules/consomac.fr.php
vendored
Normal file
9
vendor/PicoFeed/Rules/consomac.fr.php
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'test_url' => 'http://consomac.fr/news-2430-l-iphone-6-toujours-un-secret-bien-garde.html',
|
||||||
|
'body' => array(
|
||||||
|
'//div[contains(@id, "newscontent")]',
|
||||||
|
),
|
||||||
|
'strip' => array(
|
||||||
|
),
|
||||||
|
);
|
11
vendor/PicoFeed/Rules/www.bdgest.com.php
vendored
Normal file
11
vendor/PicoFeed/Rules/www.bdgest.com.php
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'test_url' => 'http://www.bdgest.com/chronique-6027-BD-Adrastee-Tome-2.html',
|
||||||
|
'body' => array(
|
||||||
|
'//*[contains(@class, "chronique")]',
|
||||||
|
),
|
||||||
|
'strip' => array(
|
||||||
|
'//*[contains(@class, "post-review")]',
|
||||||
|
'//*[contains(@class, "footer-review")]',
|
||||||
|
),
|
||||||
|
);
|
11
vendor/PicoFeed/Rules/www.universfreebox.com.php
vendored
Normal file
11
vendor/PicoFeed/Rules/www.universfreebox.com.php
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
return array(
|
||||||
|
'test_url' => 'http://www.universfreebox.com/article/24305/4G-Bouygues-Telecom-lance-une-vente-flash-sur-son-forfait-Sensation-3Go',
|
||||||
|
'body' => array(
|
||||||
|
'//div[@id="corps_corps"]'
|
||||||
|
),
|
||||||
|
'strip' => array(
|
||||||
|
'//*[@id="formulaire"]',
|
||||||
|
'//*[@id="commentaire"]',
|
||||||
|
),
|
||||||
|
);
|
Loading…
Reference in New Issue
Block a user