]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_comics/filters/af_comics_darklegacy.php
2 class Af_Comics_DarkLegacy
extends Af_ComicFilter
{
5 return array("Dark Legacy Comics");
8 function process(&$article) {
9 $owner_uid = $article["owner_uid"];
11 if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) {
12 if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
14 print "DLC!" . $article["link"] . "\n";
16 $res = fetch_file_contents($article["link"], false, false, false,
18 "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
20 global $fetch_last_error_content;
22 if (!$res && $fetch_last_error_content)
23 $res = $fetch_last_error_content;
25 $doc = new DOMDocument();
26 @$doc->loadHTML($res);
31 $xpath = new DOMXPath($doc);
32 $basenode = $xpath->query('//div[@class="comic"]')->item(0);
36 $article["content"] = $doc->saveXML($basenode);
37 $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
40 } else if (isset($article["stored"]["content"])) {
41 $article["content"] = $article["stored"]["content"];