From: Andrew Dolgov Date: Tue, 21 Oct 2014 12:53:17 +0000 (+0400) Subject: add af_comics filter for toothpastefordinner X-Git-Tag: 1.15~25 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=110ce72a72468c30ffb9bb9b77e449314e4b10a1 add af_comics filter for toothpastefordinner --- diff --git a/plugins/af_comics/filters/af_comics_tfd.php b/plugins/af_comics/filters/af_comics_tfd.php new file mode 100644 index 00000000..c4e59455 --- /dev/null +++ b/plugins/af_comics/filters/af_comics_tfd.php @@ -0,0 +1,32 @@ +loadHTML(fetch_file_contents($article["link"])); + + $basenode = false; + + if ($doc) { + $xpath = new DOMXPath($doc); + $basenode = $xpath->query('//img[@class="comic"]')->item(0); + + if ($basenode) { + $article["content"] = $doc->saveXML($basenode); + return true; + } + } + } + + return false; + } +} +?>