]> git.wh0rd.org Git - tt-rss.git/commitdiff
support dc:date elements in rss and atom feeds
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 1 Jun 2013 05:49:56 +0000 (09:49 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 1 Jun 2013 05:49:56 +0000 (09:49 +0400)
classes/feeditem/atom.php
classes/feeditem/rss.php

index 489c5b148e62f14f00de571492f93e5425f54acd..c9f5b5c62df6ebfbca99d726963bb982f7a6034b 100644 (file)
@@ -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() {
index e09a1fbba245e08d155e20994da4772d4453d7cd..e5960243cf2b723195981bae471d38a5cd9b66c4 100644 (file)
@@ -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() {