diff options
Diffstat (limited to 'plugins/af_readability/init.php')
-rwxr-xr-x | plugins/af_readability/init.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index be9220cda..a39cc278e 100755 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -1,6 +1,8 @@ <?php -use andreskrey\Readability\Readability; -use andreskrey\Readability\Configuration; +require_once __DIR__ . "/vendor/autoload.php"; + +use \andreskrey\Readability\Readability; +use \andreskrey\Readability\Configuration; class Af_Readability extends Plugin { @@ -8,7 +10,7 @@ class Af_Readability extends Plugin { private $host; function about() { - return array(1.0, + return array(null, "Try to inline article content using Readability", "fox"); } @@ -188,8 +190,6 @@ class Af_Readability extends Plugin { public function extract_content($url) { - global $fetch_effective_url; - $tmp = UrlHelper::fetch([ "url" => $url, "http_accept" => "text/*", @@ -222,13 +222,13 @@ class Af_Readability extends Plugin { foreach ($entries as $entry) { if ($entry->hasAttribute("href")) { $entry->setAttribute("href", - rewrite_relative_url($fetch_effective_url, $entry->getAttribute("href"))); + rewrite_relative_url(UrlHelper::$fetch_effective_url, $entry->getAttribute("href"))); } if ($entry->hasAttribute("src")) { $entry->setAttribute("src", - rewrite_relative_url($fetch_effective_url, $entry->getAttribute("src"))); + rewrite_relative_url(UrlHelper::$fetch_effective_url, $entry->getAttribute("src"))); } } |