fix af_sciam

This commit is contained in:
Andrew Dolgov 2013-08-02 12:17:38 +04:00
parent 623d1308c0
commit 54af7f84ad
1 changed files with 4 additions and 2 deletions

View File

@ -18,7 +18,7 @@ class Af_SciAm extends Plugin {
function hook_article_filter($article) { function hook_article_filter($article) {
$owner_uid = $article["owner_uid"]; $owner_uid = $article["owner_uid"];
if (strpos($article["link"], "scientificamerican.com") !== FALSE) { if (strpos($article["link"], "scientificamerican.com") !== FALSE || strpos($article["link"], "rss.sciam.com") !== FALSE) {
if (strpos($article["plugin_data"], "sciam,$owner_uid:") === FALSE) { if (strpos($article["plugin_data"], "sciam,$owner_uid:") === FALSE) {
$doc = new DOMDocument(); $doc = new DOMDocument();
@ -27,7 +27,9 @@ class Af_SciAm extends Plugin {
$basenode = false; $basenode = false;
if ($doc) { if ($doc) {
$basenode = $doc->getElementById("article_content"); $xpath = new DOMXpath($doc);
$basenode = $xpath->query("//*[@id='singleBlogPost' or @id='articleContent']")->item(0);
if ($basenode) { if ($basenode) {
$article["content"] = $doc->saveXML($basenode); $article["content"] = $doc->saveXML($basenode);