]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_elreg/init.php
2 class Af_ElReg
extends Plugin
{
8 "Fetch content of The Register feeds",
12 function init($host) {
15 $host->add_hook($host::HOOK_ARTICLE_FILTER
, $this);
18 function hook_article_filter($article) {
19 if (strpos($article["link"], "theregister.co.uk") !== FALSE) {
21 $doc = new DOMDocument();
22 @$doc->loadHTML(fetch_file_contents($article["link"]));
27 $xpath = new DOMXPath($doc);
29 $trash = $xpath->query("//*[@class='wptl top' or @class='wptl btm']");
31 foreach ($trash as $t) {
32 $t->parentNode
->removeChild($t);
35 $basenode = $doc->getElementById("body");
38 $article["content"] = $doc->saveXML($basenode);
46 function api_version() {