Add support for sillies
This commit is contained in:
parent
945346cbff
commit
a3013adedd
|
@ -8,8 +8,8 @@ class Af_Comics_Cad extends Af_ComicFilter {
|
||||||
function process(&$article) {
|
function process(&$article) {
|
||||||
$owner_uid = $article["owner_uid"];
|
$owner_uid = $article["owner_uid"];
|
||||||
|
|
||||||
if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
|
if (strpos($article["title"], "News:") === FALSE) {
|
||||||
if (strpos($article["title"], "News:") === FALSE) {
|
if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
@$doc->loadHTML(fetch_file_contents($article["link"]));
|
@$doc->loadHTML(fetch_file_contents($article["link"]));
|
||||||
|
@ -24,9 +24,24 @@ class Af_Comics_Cad extends Af_ComicFilter {
|
||||||
$article["content"] = $doc->saveXML($basenode);
|
$article["content"] = $doc->saveXML($basenode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elseif (strpos($article["link"], "cad-comic.com/sillies/") !== FALSE) {
|
||||||
|
$doc = new DOMDocument();
|
||||||
|
@$doc->loadHTML(fetch_file_contents($article["link"]));
|
||||||
|
|
||||||
|
$basenode = false;
|
||||||
|
|
||||||
|
if ($doc) {
|
||||||
|
$xpath = new DOMXPath($doc);
|
||||||
|
$basenode = $xpath->query('(//img[contains(@src, "/comics/sillies-")])')->item(0);
|
||||||
|
|
||||||
|
if ($basenode) {
|
||||||
|
$article["content"] = $doc->saveXML($basenode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue