From: Andrew Dolgov Date: Sat, 1 Jun 2013 05:49:56 +0000 (+0400) Subject: support dc:date elements in rss and atom feeds X-Git-Tag: 1.8~38 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=ce5d234d636bea707b69d0c63192eecdf9e7d1d4;p=tt-rss.git support dc:date elements in rss and atom feeds --- diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index 489c5b14..c9f5b5c6 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -16,6 +16,12 @@ class FeedItem_Atom extends FeedItem_Common { if ($updated) { return strtotime($updated->nodeValue); } + + $date = $this->xpath->query("dc:date", $this->elem)->item(0); + + if ($date) { + return strtotime($date->nodeValue); + } } function get_link() { diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index e09a1fbb..e5960243 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -16,6 +16,12 @@ class FeedItem_RSS extends FeedItem_Common { if ($pubDate) { return strtotime($pubDate->nodeValue); } + + $date = $this->xpath->query("dc:date", $this->elem)->item(0); + + if ($date) { + return strtotime($date->nodeValue); + } } function get_link() {