]>
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();
25 $links = $this->elem
->getElementsByTagName("link");
27 foreach ($links as $link) {
28 if ($link && $link->hasAttribute("href") && !$link->hasAttribute("rel")) {
29 return $link->getAttribute("href");
34 function get_title() {
35 $title = $this->elem
->getElementsByTagName("title")->item(0);
38 return $title->nodeValue
;
42 function get_content() {
43 $content = $this->elem
->getElementsByTagName("content")->item(0);
46 return $content->nodeValue
;
50 function get_description() {
51 $summary = $this->elem
->getElementsByTagName("summary")->item(0);
54 return $summary->nodeValue
;
59 function get_comments_url() {
64 function get_comments_count() {
68 function get_categories() {
69 $categories = $this->elem
->getElementsByTagName("category");
72 foreach ($categories as $cat) {
73 if ($cat->hasAttribute("term"))
74 array_push($cats, $cat->getAttribute("term"));
81 function get_enclosures() {
82 $links = $this->elem
->getElementsByTagName("link");
86 foreach ($links as $link) {
87 if ($link && $link->hasAttribute("href") && $link->hasAttribute("rel")) {
88 if ($link->getAttribute("rel") == "enclosure") {
89 $enc = new FeedEnclosure();
91 $enc->type
= $link->getAttribute("type");
92 $enc->link
= $link->getAttribute("href");
93 $enc->length
= $link->getAttribute("length");
95 array_push($encs, $enc);
103 function get_author() {
104 $author = $this->elem
->getElementsByTagName("author")->item(0);
107 $name = $author->getElementsByTagName("name")->item(0);
109 if ($name) return $name->nodeValue
;
111 $email = $author->getElementsByTagName("email")->item(0);
113 if ($email) return $email->nodeValue
;