You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
633 B
PHP
34 lines
633 B
PHP
<?php
|
|
class Af_Comics_Explosm extends Af_ComicFilter {
|
|
|
|
function supported() {
|
|
return array("Cyanide and Happiness");
|
|
}
|
|
|
|
function process(&$article) {
|
|
$owner_uid = $article["owner_uid"];
|
|
|
|
if (strpos($article["link"], "explosm.net/comics") !== FALSE) {
|
|
|
|
$doc = new DOMDocument();
|
|
@$doc->loadHTML(fetch_file_contents($article["link"]));
|
|
|
|
$basenode = false;
|
|
|
|
if ($doc) {
|
|
$xpath = new DOMXPath($doc);
|
|
$basenode = $xpath->query('(//img[@id="main-comic"])')->item(0);
|
|
|
|
if ($basenode) {
|
|
$article["content"] = $doc->saveXML($basenode);
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
?>
|