]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_csection/init.php
bfc5b0061d6ef7902922ab819ac79c46da7478d6
2 class Af_CSection
extends Plugin
{
8 "Fix csection rss feed",
12 function init($host) {
15 $host->add_hook($host::HOOK_ARTICLE_FILTER
, $this);
18 function hook_article_filter($article) {
19 $owner_uid = $article["owner_uid"];
21 if (strpos($article["guid"], "csectioncomics.com") !== FALSE) {
22 if (strpos($article["plugin_data"], "csection,$owner_uid:") === FALSE) {
24 $doc = new DOMDocument();
25 @$doc->loadHTML(fetch_file_contents($article["link"]));
30 $xpath = new DOMXPath($doc);
31 $basenode = $xpath->query('//div[@id="comic"]')->item(0);
34 $article["content"] = $doc->saveXML($basenode);
35 $article["plugin_data"] = "csection,$owner_uid:" . $article["plugin_data"];
38 } else if (isset($article["stored"]["content"])) {
39 $article["content"] = $article["stored"]["content"];
46 function api_version() {