]> git.wh0rd.org Git - tt-rss.git/commitdiff
af_natgeo: remove some unneeded elements
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 2 Aug 2013 07:06:51 +0000 (11:06 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 2 Aug 2013 07:06:51 +0000 (11:06 +0400)
plugins/af_natgeo/init.php

index 7dc7116dd26455ad2743b179efa447601cde7f8d..72354c1c88687a1109e910b1b5ed679fcd4061bc 100644 (file)
@@ -27,8 +27,16 @@ class Af_NatGeo extends Plugin {
                                $basenode = false;
 
                                if ($doc) {
+                                       $xpath = new DOMXPath($doc);
+
                                        $basenode = $doc->getElementById("content_mainA");
 
+                                       $trash = $xpath->query("//*[@class='aside' or @id='livefyre' or @id='powered_by_livefyre' or @class='social_buttons']");
+
+                                       foreach ($trash as $t) {
+                                               $t->parentNode->removeChild($t);
+                                       }
+
                                        if ($basenode) {
                                                $article["content"] = $doc->saveXML($basenode);
                                                $article["plugin_data"] = "natgeo,$owner_uid:" . $article["plugin_data"];