]> git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/filters/af_comics_pvp.php
af_comics: add pvponline
[tt-rss.git] / plugins / af_comics / filters / af_comics_pvp.php
1 <?php
2 class Af_Comics_Pvp extends Af_ComicFilter {
3
4 function supported() {
5 return array("PvP Online");
6 }
7
8 function process(&$article) {
9 if (strpos($article["guid"], "pvponline.com") !== FALSE) {
10
11 $res = fetch_file_contents($article["link"], false, false, false,
12 false, false, 0,
13 "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
14
15 $doc = new DOMDocument();
16 @$doc->loadHTML($res);
17
18 if ($doc) {
19 $xpath = new DOMXPath($doc);
20 $basenode = $xpath->query('//section[@class="comic-art"]')->item(0);
21
22 if ($basenode) {
23 $article["content"] = $doc->saveXML($basenode);
24 }
25 }
26
27 return true;
28 }
29
30 return false;
31 }
32 }
33 ?>