1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-07-11 14:14:10 +02:00
ttrss/plugins/af_comics/filters/af_comics_cad.php
Andrew Dolgov 1929149661 Revert "Add support for sillies"
idiot submitter breaks all embedding with his genius strategy of
handling all posts with now News: in title

This reverts commit a3013adedd.
2015-05-15 09:31:02 +03:00

37 lines
695 B
PHP

<?php
class Af_Comics_Cad extends Af_ComicFilter {
function supported() {
return array("Ctrl+Alt+Del");
}
function process(&$article) {
$owner_uid = $article["owner_uid"];
if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) {
if (strpos($article["title"], "News:") === 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/cad-")])')->item(0);
if ($basenode) {
$article["content"] = $doc->saveXML($basenode);
}
}
}
return true;
}
return false;
}
}
?>