diff options
Diffstat (limited to 'plugins/af_comics/filters/af_comics_twp.php')
-rw-r--r-- | plugins/af_comics/filters/af_comics_twp.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/af_comics/filters/af_comics_twp.php b/plugins/af_comics/filters/af_comics_twp.php new file mode 100644 index 000000000..ec43c1379 --- /dev/null +++ b/plugins/af_comics/filters/af_comics_twp.php @@ -0,0 +1,33 @@ +<?php +class Af_Comics_Twp extends Af_ComicFilter { + + function supported() { + return array("Three Word Phrase"); + } + + function process(&$article) { + + if (strpos($article["link"], "threewordphrase.com") !== FALSE) { + + $doc = new DOMDocument(); + @$doc->loadHTML(fetch_file_contents($article["link"])); + + $basenode = false; + + if ($doc) { + $xpath = new DOMXpath($doc); + + $basenode = $xpath->query("//td/center/img")->item(0); + + if ($basenode) { + $article["content"] = $doc->saveXML($basenode); + } + } + + return true; + } + + return false; + } +} +?> |