Browse Source

support dc:date elements in rss and atom feeds

Andrew Dolgov 7 years ago
parent
commit
ce5d234d63
2 changed files with 12 additions and 0 deletions
  1. 6 0
      classes/feeditem/atom.php
  2. 6 0
      classes/feeditem/rss.php

+ 6 - 0
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() {

+ 6 - 0
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() {