}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
+ if (strpos($article["link"], "cad-comic.com") !== FALSE) {
+ if (strpos($article["title"], "News:") === FALSE) {
- if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
- if (strpos($article["title"], "News:") === FALSE && strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) {
+ global $fetch_last_error_content;
$doc = new DOMDocument();
- @$doc->loadHTML(fetch_file_contents($article["link"]));
- $basenode = false;
+ $res = fetch_file_contents($article["link"], false, false, false,
+ false, false, 0,
+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0");
- if ($doc) {
+ if (!$res && $fetch_last_error_content)
+ $res = $fetch_last_error_content;
+
+ if (@$doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
- $basenode = $xpath->query('(//img[contains(@src, "/comics/cad-")])')->item(0);
+ $basenode = $xpath->query('//div[@class="comicpage"]/a/img')->item(0);
if ($basenode) {
- $article["content"] = $doc->saveXML($basenode);
- $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"];
+ $article["content"] = $doc->saveHTML($basenode);
}
}
- } else if (isset($article["stored"]["content"])) {
- $article["content"] = $article["stored"]["content"];
}
return true;
return false;
}
}
-?>