Not tested/Dont intend to

This commit is contained in:
Aeris 2022-05-20 22:10:13 +02:00
parent a8e6de1964
commit 316aae15ad
1 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,11 @@
<?php
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';