From: Andrew Dolgov Date: Fri, 12 Jun 2015 09:19:50 +0000 (+0300) Subject: add a generic af_comics filter for .comic class sites (much like comicpress handles... X-Git-Tag: 16.3~311 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7624aa6e4042a66a60ca2ffb0035efcc3d8d51c5;p=tt-rss.git add a generic af_comics filter for .comic class sites (much like comicpress handles id comic, i guess) --- diff --git a/plugins/af_comics/filters/af_comics_comicclass.php b/plugins/af_comics/filters/af_comics_comicclass.php new file mode 100644 index 00000000..45698751 --- /dev/null +++ b/plugins/af_comics/filters/af_comics_comicclass.php @@ -0,0 +1,40 @@ +loadHTML($res); + + $basenode = false; + + if ($doc) { + $xpath = new DOMXPath($doc); + $basenode = $xpath->query('//div[@class="comic"]')->item(0); + + if ($basenode) { + $article["content"] = $doc->saveXML($basenode); + } + } + + return true; + } + + return false; + } +} +?>