From f666451b86a08d61d10f4137882e8c468518414d Mon Sep 17 00:00:00 2001 From: kroka Date: Sun, 11 Jan 2015 15:14:58 +0100 Subject: [PATCH] Replace an article's link (instead of its content) Added a new option `mod_link` to allow the modification of an article's link. *Example:* http://feeds.feedburner.com/rivva ```json "rivva.de": { "type": "xpath", "xpath": "header/h1/a/@href", "force_charset": "utf-8", "mod_link": true } ``` --- init.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.php b/init.php index d324bad..28fea79 100644 --- a/init.php +++ b/init.php @@ -142,7 +142,13 @@ class Af_Feedmod extends Plugin implements IHandler } } } - $article['content'] = $doc->saveXML($basenode); + + // modify the article + if ($config['mod_link']) { + $article['link'] = $basenode->textContent; + } else { + $article['content'] = $doc->saveXML($basenode); + } $article['plugin_data'] = "feedmod,$owner_uid:" . $article['plugin_data']; } }