This commit is contained in:
Aeris 2022-05-21 16:23:44 +02:00
parent 5be8defd38
commit e4230379d0
1 changed files with 5 additions and 5 deletions

View File

@ -22,16 +22,15 @@ class ReadabilityExtension extends Minz_Extension {
];
foreach ( $regex as $ex ) {
print "Iterating";
if (false !== strpos($entry->link(), $ex ) ) {
$read = true;
}
}
if (! $read){
print "Constantly failing";
return $entry;
}
print "should work";
$data = "{\"url\": \"" . $entry->link() ."\"}";
$headers[] = 'Content-Type: application/json';
@ -41,14 +40,15 @@ class ReadabilityExtension extends Minz_Extension {
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($c);
$c_status = curl_getinfo($c, CURLINFO_HTTP_CODE);
//$c_error = curl_error($c);
curl_close($c);
if ($c_status !== 200) {
return $entry;
return $entry;
}
$val = json_decode($result, true);
$entry->_content($val["content"]);
return $entry;
}