]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix af_sciam
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 2 Aug 2013 08:17:38 +0000 (12:17 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 2 Aug 2013 08:17:38 +0000 (12:17 +0400)
plugins/af_sciam/init.php

index cb555943365a2aa9b0c977c88f1affe0cec01953..658265e507dfeca3c22fd6532ed2ee07cf3c9856 100644 (file)
@@ -18,7 +18,7 @@ class Af_SciAm extends Plugin {
        function hook_article_filter($article) {
                $owner_uid = $article["owner_uid"];
 
-               if (strpos($article["link"], "scientificamerican.com") !== FALSE) {
+               if (strpos($article["link"], "scientificamerican.com") !== FALSE || strpos($article["link"], "rss.sciam.com") !== FALSE) {
                        if (strpos($article["plugin_data"], "sciam,$owner_uid:") === FALSE) {
 
                                $doc = new DOMDocument();
@@ -27,7 +27,9 @@ class Af_SciAm extends Plugin {
                                $basenode = false;
 
                                if ($doc) {
-                                       $basenode = $doc->getElementById("article_content");
+                                       $xpath = new DOMXpath($doc);
+
+                                       $basenode = $xpath->query("//*[@id='singleBlogPost' or @id='articleContent']")->item(0);
 
                                        if ($basenode) {
                                                $article["content"] = $doc->saveXML($basenode);