]> git.wh0rd.org - tt-rss.git/blobdiff - plugins/af_redditimgur/init.php
af_redditimgur: do not reinline content extracted by readability
[tt-rss.git] / plugins / af_redditimgur / init.php
index 7eafec68265ead2ac707549e4a84ade6d5109a41..a9f7f1760d0730bbb3a9d0e88b3f0c1876fcbb6d 100644 (file)
@@ -243,7 +243,7 @@ class Af_RedditImgur extends Plugin {
                        if (function_exists("curl_init") && !$found && $this->host->get($this, "enable_readability") &&
                                mb_strlen(strip_tags($article["content"])) <= 150) {
 
-                               if (!class_exists("Readability")) require_once(__DIR__ . "/classes/Readability.php");
+                               if (!class_exists("Readability")) require_once(dirname(dirname(__DIR__)). "/lib/readability/Readability.php");
 
                                $content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0);
 
@@ -272,7 +272,6 @@ class Af_RedditImgur extends Plugin {
                                                        $r = new Readability($tmp, $content_link->getAttribute("href"));
 
                                                        if ($r->init()) {
-                                                               //$article["content"] = $r->articleContent->innerHTML . "<hr/>" . $article["content"];
 
                                                                $tmpxpath = new DOMXPath($r->dom);
 
@@ -295,11 +294,13 @@ class Af_RedditImgur extends Plugin {
 
                                                                $article["content"] = $r->articleContent->innerHTML . "<hr/>" . $article["content"];
 
-                                                               $doc = new DOMDocument();
-                                                               @$doc->loadHTML($article["content"]);
-                                                               $xpath = new DOMXPath($doc);
+                                                               // prob not a very good idea (breaks wikipedia pages, etc) -
+                                                               // inliner currently is not really fit for any random web content
 
-                                                               $found = $this->inline_stuff($article, $doc, $xpath);
+                                                               //$doc = new DOMDocument();
+                                                               //@$doc->loadHTML($article["content"]);
+                                                               //$xpath = new DOMXPath($doc);
+                                                               //$found = $this->inline_stuff($article, $doc, $xpath);
                                                        }
                                                }
                                        }