]>
git.wh0rd.org - tt-rss.git/blob - plugins/af_sciam/init.php
2 class Af_SciAm
extends Plugin
{
8 "Fetch content of Scientific American feeds",
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["link"], "scientificamerican.com") !== FALSE ||
strpos($article["link"], "rss.sciam.com") !== FALSE) {
23 $doc = new DOMDocument();
24 @$doc->loadHTML(fetch_file_contents($article["link"]));
29 $xpath = new DOMXpath($doc);
31 $basenode = $xpath->query("//*[@id='singleBlogPost' or @id='articleContent']")->item(0);
34 $article["content"] = $doc->saveXML($basenode);
42 function api_version() {