From: Andrew Dolgov Date: Fri, 2 Aug 2013 07:06:51 +0000 (+0400) Subject: af_natgeo: remove some unneeded elements X-Git-Tag: 1.10~43 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=623d1308c0dbab0998509a6915f08a201b451e56;p=tt-rss.git af_natgeo: remove some unneeded elements --- diff --git a/plugins/af_natgeo/init.php b/plugins/af_natgeo/init.php index 7dc7116d..72354c1c 100644 --- a/plugins/af_natgeo/init.php +++ b/plugins/af_natgeo/init.php @@ -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"];