]> git.wh0rd.org - tt-rss.git/blame - plugins/af_comics/filters/af_comics_tfd.php
remove some redundant php closing tags
[tt-rss.git] / plugins / af_comics / filters / af_comics_tfd.php
CommitLineData
110ce72a
AD
1<?php
2class Af_Comics_Tfd extends Af_ComicFilter {
3
4 function supported() {
32024bdf 5 return array("Toothpaste For Dinner", "Married to the Sea");
110ce72a
AD
6 }
7
8 function process(&$article) {
32024bdf
BB
9 if (strpos($article["link"], "toothpastefordinner.com") !== FALSE ||
10 strpos($article["link"], "marriedtothesea.com") !== FALSE) {
5613bb35
AD
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)");
110ce72a 14
5613bb35
AD
15 if (!$res) return $article;
16
17 $doc = new DOMDocument();
32024bdf
BB
18 @$doc->loadHTML(fetch_file_contents($article["link"]));
19
110ce72a
AD
20 $basenode = false;
21
22 if ($doc) {
23 $xpath = new DOMXPath($doc);
32024bdf 24 $basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0);
110ce72a
AD
25
26 if ($basenode) {
27 $article["content"] = $doc->saveXML($basenode);
28 return true;
29 }
30 }
31 }
32
33 return false;
34 }
35}
36?>