]> git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/filters/af_comics_pvp.php
1a1ccab3dde42863e90a37cfa8d5d84037f6647f
[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
17 if (@$doc->loadHTML($res)) {
18 $xpath = new DOMXPath($doc);
19 $basenode = $xpath->query('//section[@class="comic-art"]')->item(0);
20
21 if ($basenode) {
22 $article["content"] = $doc->saveXML($basenode);
23 }
24 }
25
26 return true;
27 }
28
29 return false;
30 }
31 }