]>
git.wh0rd.org - tt-rss.git/blob - classes/feeditem/atom.php
5 function __construct($elem) {
10 $id = $this->elem
->getElementsByTagName("id")->item(0);
13 return $id->nodeValue
;
15 return $this->get_link();
20 $updated = $this->elem
->getElementsByTagName("updated")->item(0);
23 return strtotime($updated->nodeValue
);
28 $links = $this->elem
->getElementsByTagName("link");
30 foreach ($links as $link) {
31 if ($link && $link->hasAttribute("href") && !$link->hasAttribute("rel")) {
32 return $link->getAttribute("href");
37 function get_title() {
38 $title = $this->elem
->getElementsByTagName("title")->item(0);
41 return $title->nodeValue
;
45 function get_content() {
46 $content = $this->elem
->getElementsByTagName("content")->item(0);
49 return $content->nodeValue
;
53 function get_description() {
54 $summary = $this->elem
->getElementsByTagName("summary")->item(0);
57 return $summary->nodeValue
;
62 function get_comments_url() {
67 function get_comments_count() {
71 function get_categories() {
72 $categories = $this->elem
->getElementsByTagName("category");
75 foreach ($categories as $cat) {
76 if ($cat->hasAttribute("term"))
77 array_push($cats, $cat->getAttribute("term"));
84 function get_enclosures() {
85 $links = $this->elem
->getElementsByTagName("link");
89 foreach ($links as $link) {
90 if ($link && $link->hasAttribute("href") && $link->hasAttribute("rel")) {
91 if ($link->getAttribute("rel") == "enclosure") {
92 $enc = new FeedEnclosure();
94 $enc->type
= $link->getAttribute("type");
95 $enc->link
= $link->getAttribute("href");
96 $enc->length
= $link->getAttribute("length");
98 array_push($encs, $enc);
106 function get_author() {
107 $author = $this->elem
->getElementsByTagName("author")->item(0);
110 $name = $author->getElementsByTagName("name")->item(0);
112 if ($name) return $name->nodeValue
;
114 $email = $author->getElementsByTagName("email")->item(0);
116 if ($email) return $email->nodeValue
;