diff options
Diffstat (limited to 'classes/feeditem/rss.php')
-rw-r--r-- | classes/feeditem/rss.php | 18 |
1 files changed, 17 insertions, 1 deletions
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 @@ <?php class FeedItem_RSS { private $elem; + private $xpath; - function __construct($elem) { + function __construct($elem, $doc, $xpath) { $this->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; } |