From 4c00e15b5d05b0d137af9a33bf79172bfeb0df24 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 1 May 2013 19:40:43 +0400 Subject: pass xpath object to feeditem, support media-rss objects --- classes/feeditem/rss.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'classes/feeditem/rss.php') diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index d5667102d..e5e2a8e56 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -1,9 +1,11 @@ elem = $elem; + $this->xpath = $xpath; } function get_id() { @@ -92,6 +94,20 @@ class FeedItem_RSS { array_push($encs, $enc); } + $enclosures = $this->xpath->query("media:content", $this->elem); + + $encs = array(); + + foreach ($enclosures as $enclosure) { + $enc = new FeedEnclosure(); + + $enc->type = $enclosure->getAttribute("type"); + $enc->link = $enclosure->getAttribute("url"); + $enc->length = $enclosure->getAttribute("length"); + + array_push($encs, $enc); + } + return $encs; } -- cgit v1.2.3-54-g00ecf