]>
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->elem
->getElementsByTagName("description")->item(0);
41 return $content->nodeValue
;
44 $content = $this->xpath
->query("content:encoded", $this->elem
)->item(0);
47 return $content->nodeValue
;
52 function get_description() {
53 $summary = $this->elem
->getElementsByTagName("description")->item(0);
56 return $summary->nodeValue
;
60 function get_categories() {
61 $categories = $this->elem
->getElementsByTagName("category");
64 foreach ($categories as $cat) {
65 array_push($cats, $cat->nodeValue
);
68 $categories = $this->xpath
->query("dc:subject", $this->elem
);
70 foreach ($categories as $cat) {
71 array_push($cats, $cat->nodeValue
);
77 function get_enclosures() {
78 $enclosures = $this->elem
->getElementsByTagName("enclosure");
82 foreach ($enclosures as $enclosure) {
83 $enc = new FeedEnclosure();
85 $enc->type
= $enclosure->getAttribute("type");
86 $enc->link
= $enclosure->getAttribute("url");
87 $enc->length
= $enclosure->getAttribute("length");
89 array_push($encs, $enc);
92 $enclosures = $this->xpath
->query("media:content", $this->elem
);
94 foreach ($enclosures as $enclosure) {
95 $enc = new FeedEnclosure();
97 $enc->type
= $enclosure->getAttribute("type");
98 $enc->link
= $enclosure->getAttribute("url");
99 $enc->length
= $enclosure->getAttribute("length");
101 array_push($encs, $enc);