]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/filters/af_comics_comicclass.php
2 class Af_Comics_ComicClass
extends Af_ComicFilter
{
5 return array("Loading Artist");
8 function process(&$article) {
9 if (strpos($article["guid"], "loadingartist.com") !== FALSE) {
11 // lol at people who block clients by user agent
12 // oh noes my ad revenue Q_Q
14 $res = fetch_file_contents($article["link"], false, false, false,
16 "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
18 $doc = new DOMDocument();
20 if (@$doc->loadHTML($res)) {
21 $xpath = new DOMXPath($doc);
22 $basenode = $xpath->query('//div[@class="comic"]')->item(0);
25 $article["content"] = $doc->saveHTML($basenode);