| 1 |
<?php // -*-php-*- |
<?php // -*-php-*- |
| 2 |
/* $Id: fa_simplexml.module,v 1.1.2.10 2007/11/24 14:04:38 alaa Exp $ */ |
/* $Id: fa_simplexml.module,v 1.1.2.11 2008/06/08 20:43:17 alaa Exp $ */ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implementation of hook_fooaggregatorapi() |
* Implementation of hook_fooaggregatorapi() |
| 175 |
$node['enclosures'] = (string) $item->enclosure['url']; |
$node['enclosures'] = (string) $item->enclosure['url']; |
| 176 |
break; |
break; |
| 177 |
case 'feed' /* atom */: |
case 'feed' /* atom */: |
| 178 |
$node['link'] = (string) $item->link['href']; |
//items can have multiple links |
| 179 |
|
if (count($item->link) > 1) { |
| 180 |
|
foreach ($item->link as $link) { |
| 181 |
|
if ((string) $link['rel'] == 'alternate') { |
| 182 |
|
$node['link'] = (string) $link['href']; |
| 183 |
|
break; |
| 184 |
|
} |
| 185 |
|
} |
| 186 |
|
} else { |
| 187 |
|
$node['link'] = (string) $item->link['href']; |
| 188 |
|
} |
| 189 |
$node['body'] = $item->content ? (string) $item->content : (string) $item->summary; |
$node['body'] = $item->content ? (string) $item->content : (string) $item->summary; |
| 190 |
$node['guid'] = (string) $item->id; |
$node['guid'] = (string) $item->id; |
| 191 |
$node['date'] = $item->published ? (string) $item->published : $item->issued ? (string) $item->issued : $item->created ? (string) $item->created : $item->updated ? (string) $item->updated : (string) $item->modified; |
$node['date'] = $item->published ? (string) $item->published : $item->issued ? (string) $item->issued : $item->created ? (string) $item->created : $item->updated ? (string) $item->updated : (string) $item->modified; |