Not tested/Dont intend to
This commit is contained in:
parent
a8e6de1964
commit
316aae15ad
|
@ -2,6 +2,11 @@
|
|||
|
||||
class ReadabilityExtension extends Minz_Extension {
|
||||
|
||||
const regex = [
|
||||
'#^https?://.*washingtonpost.com/#i',
|
||||
'#^https?://.*heise.de/#i'
|
||||
];
|
||||
|
||||
public function init() {
|
||||
$this->registerTranslates();
|
||||
|
||||
|
@ -12,6 +17,17 @@ class ReadabilityExtension extends Minz_Extension {
|
|||
|
||||
public function fetchStuff($entry) {
|
||||
|
||||
$read = false;
|
||||
|
||||
foreach ( $regex as $ex ) {
|
||||
if ( preg_match($ex, $entry->link()) === 1 ) {
|
||||
$read = true;
|
||||
}
|
||||
}
|
||||
if (! $read){
|
||||
return $entry;
|
||||
}
|
||||
|
||||
$data = "{\"url\": \"" . $entry->link() ."\"}";
|
||||
$headers[] = 'Content-Type: application/json';
|
||||
|
||||
|
|
Loading…
Reference in a new issue