1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 11:45:56 +00:00

pass xpath object to feeditem, support media-rss objects

This commit is contained in:
Andrew Dolgov
2013-05-01 19:40:43 +04:00
parent fd0daa9b55
commit 4c00e15b5d
3 changed files with 21 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ class FeedParser {
$root = $this->doc->firstChild;
$xpath = new DOMXPath($this->doc);
$xpath->registerNamespace('atom', 'http://www.w3.org/2005/Atom');
$xpath->registerNamespace('media', 'http://search.yahoo.com/mrss/');
$this->xpath = $xpath;
$root = $xpath->query("(//atom:feed|//channel)")->item(0);
@@ -62,7 +63,7 @@ class FeedParser {
$articles = $xpath->query("//atom:entry");
foreach ($articles as $article) {
array_push($this->items, new FeedItem_Atom($article));
array_push($this->items, new FeedItem_Atom($article, $this->doc, $this->xpath));
}
break;
@@ -83,7 +84,7 @@ class FeedParser {
$articles = $xpath->query("//channel/item");
foreach ($articles as $article) {
array_push($this->items, new FeedItem_RSS($article));
array_push($this->items, new FeedItem_RSS($article, $this->doc, $this->xpath));
}
break;