af_natgeo: remove some unneeded elements
This commit is contained in:
parent
c309f41d2d
commit
623d1308c0
|
@ -27,8 +27,16 @@ class Af_NatGeo extends Plugin {
|
||||||
$basenode = false;
|
$basenode = false;
|
||||||
|
|
||||||
if ($doc) {
|
if ($doc) {
|
||||||
|
$xpath = new DOMXPath($doc);
|
||||||
|
|
||||||
$basenode = $doc->getElementById("content_mainA");
|
$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) {
|
if ($basenode) {
|
||||||
$article["content"] = $doc->saveXML($basenode);
|
$article["content"] = $doc->saveXML($basenode);
|
||||||
$article["plugin_data"] = "natgeo,$owner_uid:" . $article["plugin_data"];
|
$article["plugin_data"] = "natgeo,$owner_uid:" . $article["plugin_data"];
|
||||||
|
|
Loading…
Reference in New Issue