]>
git.wh0rd.org - tt-rss.git/blob - classes/feeditem/rss.php
2 class FeedItem_RSS
extends FeedItem_Common
{
4 $id = $this->elem
->getElementsByTagName("guid")->item(0);
9 return $this->get_link();
14 $pubDate = $this->elem
->getElementsByTagName("pubDate")->item(0);
17 return strtotime($pubDate->nodeValue
);
22 $link = $this->elem
->getElementsByTagName("link")->item(0);
25 return $link->nodeValue
;
29 function get_title() {
30 $title = $this->elem
->getElementsByTagName("title")->item(0);
33 return $title->nodeValue
;
37 function get_content() {
38 $content = $this->xpath
->query("content:encoded", $this->elem
)->item(0);
41 return $content->nodeValue
;
44 $content = $this->elem
->getElementsByTagName("description")->item(0);
47 return $content->nodeValue
;
51 function get_description() {
52 $summary = $this->elem
->getElementsByTagName("description")->item(0);
55 return $summary->nodeValue
;
59 function get_categories() {
60 $categories = $this->elem
->getElementsByTagName("category");
63 foreach ($categories as $cat) {
64 array_push($cats, $cat->nodeValue
);
67 $categories = $this->xpath
->query("dc:subject", $this->elem
);
69 foreach ($categories as $cat) {
70 array_push($cats, $cat->nodeValue
);
76 function get_enclosures() {
77 $enclosures = $this->elem
->getElementsByTagName("enclosure");
81 foreach ($enclosures as $enclosure) {
82 $enc = new FeedEnclosure();
84 $enc->type
= $enclosure->getAttribute("type");
85 $enc->link
= $enclosure->getAttribute("url");
86 $enc->length
= $enclosure->getAttribute("length");
88 array_push($encs, $enc);
91 $enclosures = $this->xpath
->query("media:content", $this->elem
);
93 foreach ($enclosures as $enclosure) {
94 $enc = new FeedEnclosure();
96 $enc->type
= $enclosure->getAttribute("type");
97 $enc->link
= $enclosure->getAttribute("url");
98 $enc->length
= $enclosure->getAttribute("length");
100 array_push($encs, $enc);