Fix Danby Draws
This commit is contained in:
@@ -4,14 +4,13 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
|
||||
function supported() {
|
||||
return array("Buni", "Buttersafe", "Happy Jar", "CSection",
|
||||
"Extra Fabulous Comics", "Nedroid", "Stonetoss",
|
||||
"Danby Draws", "Powerup Comics");
|
||||
"Powerup Comics");
|
||||
}
|
||||
|
||||
function process(&$article) {
|
||||
if (str_contains($article["guid"], "bunicomic.com") ||
|
||||
str_contains($article["guid"], "buttersafe.com") ||
|
||||
str_contains($article["guid"], "extrafabulouscomics.com") ||
|
||||
str_contains($article["guid"], "danbydraws.com") ||
|
||||
str_contains($article["guid"], "theduckwebcomics.com/Powerup_Comics") ||
|
||||
str_contains($article["guid"], "happyjar.com") ||
|
||||
str_contains($article["guid"], "nedroid.com") ||
|
||||
|
||||
27
plugins/af_comics/filters/af_comics_danbydraws.php
Normal file
27
plugins/af_comics/filters/af_comics_danbydraws.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class Af_Comics_DanbyDraws extends Af_ComicFilter {
|
||||
|
||||
function supported() {
|
||||
return array("Danby Draws");
|
||||
}
|
||||
|
||||
function process(&$article) {
|
||||
if (str_contains($article["link"], "danbydraws.com")) {
|
||||
$res = UrlHelper::fetch(["url" => $article["link"]]);
|
||||
|
||||
$doc = new DOMDocument();
|
||||
|
||||
if ($res && $doc->loadHTML($res)) {
|
||||
$xpath = new DOMXPath($doc);
|
||||
$basenode = $xpath->query('//div[@id="comic"]|//img[contains(@class, "wp-post-image")]/..')->item(0);
|
||||
|
||||
if ($basenode) {
|
||||
$article["content"] = $doc->saveHTML($basenode);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user