Permalink
Browse files

make that atom fix more general

  • Loading branch information...
1 parent 6fe0320 commit 531d6ee20364a6b24a9ac7bff357cae2458ec4c2 @chregu committed Jun 3, 2009
Showing with 17 additions and 5 deletions.
  1. +17 −5 libs/aggregator.php
View
@@ -44,8 +44,14 @@ function aggregateAllBlogs($id = null) {
continue;
}
//check if this blog already exists
-
- if (!$feed->channel['link']) {
+ if (isset($feed->channel['atom'])) {
+ foreach($feed->channel['atom'] as $k => $v) {
+ if (!isset($feed->channel[$k])) {
+ $feed->channel[$k] = $v;
+ }
+ }
+ }
+ if (!$feed->channel['link']) {
if (isset($feed->channel['link_'])) {
$feed->channel['link'] = $feed->channel['link_'];
} else if (isset($feed->channel['link_self'])) {
@@ -85,21 +91,27 @@ function aggregateAllBlogs($id = null) {
//loop through feeds
foreach ($feed->items as $item) {
+ if (isset($item['atom']) && is_array($item['atom'])) {
+ foreach($item['atom'] as $k => $v) {
+ if (!isset($item[$k])) {
+ $item[$k] = $v;
+ }
+ }
+ }
if (!isset($item['link']) && isset($item['link_'])) {
$item['link'] = $item['link_'];
}
+
if (isset($item['guid'])) {
$guid = $item['guid'];
} else if (isset($item['id'])) {
$guid = $item['id'];
$item['guid'] = $item['id'];
- } else if (isset($item['atom']['link'])) {
- $guid = $item['atom']['link'];
- $item['guid'] = $guid;
} else {
$guid = $item['link'];
$item['guid'] = $item['link'];
}
+
$_date = strtotime($this->getDcDate($item,0 , true));
if ($_date and $_date < time() - 3600 * 24 * 180 ) {

0 comments on commit 531d6ee

Please sign in to comment.