2014-02-17 10:00:25 +01:00
|
|
|
<?php
|
|
|
|
class Af_Comics_Explosm extends Af_ComicFilter {
|
|
|
|
|
|
|
|
function supported() {
|
|
|
|
return array("Cyanide and Happiness");
|
|
|
|
}
|
|
|
|
|
|
|
|
function process(&$article) {
|
|
|
|
|
|
|
|
if (strpos($article["link"], "explosm.net/comics") !== FALSE) {
|
|
|
|
|
|
|
|
$doc = new DOMDocument();
|
|
|
|
|
2017-04-26 19:57:36 +02:00
|
|
|
if (@$doc->loadHTML(fetch_file_contents($article["link"]))) {
|
2014-02-17 10:00:25 +01:00
|
|
|
$xpath = new DOMXPath($doc);
|
2014-12-12 10:23:33 +01:00
|
|
|
$basenode = $xpath->query('(//img[@id="main-comic"])')->item(0);
|
2014-02-17 10:00:25 +01:00
|
|
|
|
|
|
|
if ($basenode) {
|
2017-09-09 20:51:59 +02:00
|
|
|
$article["content"] = $doc->saveHTML($basenode);
|
2014-02-17 10:00:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2017-09-09 20:51:59 +02:00
|
|
|
}
|