]>
git.wh0rd.org - tt-rss.git/blob - classes/feeditem/common.php
2 abstract class FeedItem_Common
extends FeedItem
{
7 function __construct($elem, $doc, $xpath) {
14 $source = $elem->getElementsByTagName("source")->item(0);
16 // we don't need <source> element
18 $elem->removeChild($source);
19 } catch (DOMException
$e) {
24 function get_author() {
25 $author = $this->elem
->getElementsByTagName("author")->item(0);
28 $name = $author->getElementsByTagName("name")->item(0);
30 if ($name) return $name->nodeValue
;
32 $email = $author->getElementsByTagName("email")->item(0);
34 if ($email) return $email->nodeValue
;
36 if ($author->nodeValue
)
37 return $author->nodeValue
;
40 $author = $this->xpath
->query("dc:creator", $this->elem
)->item(0);
43 return $author->nodeValue
;
48 function get_comments_url() {
52 function get_comments_count() {
53 $comments = $this->xpath
->query("slash:comments", $this->elem
)->item(0);
56 return $comments->nodeValue
;