Skip to content
Snippets Groups Projects
Commit a0de7ea3 authored by Alex Barth's avatar Alex Barth
Browse files

Clean up _parser_common_syndication_atom10_parse().

parent c34d1df5
No related branches found
No related tags found
No related merge requests found
...@@ -116,11 +116,9 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -116,11 +116,9 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
$parsed_source['items'] = array(); $parsed_source['items'] = array();
foreach ($feed_XML->entry as $news) { foreach ($feed_XML->entry as $news) {
$original_url = NULL;
$original_url = NULL;
$guid = !empty($news->id) ? "{$news->id}" : NULL; $guid = !empty($news->id) ? "{$news->id}" : NULL;
// I don't know how standard this is, but sometimes the id is the URL.
if (valid_url($guid, TRUE)) { if (valid_url($guid, TRUE)) {
$original_url = $guid; $original_url = $guid;
} }
...@@ -144,7 +142,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -144,7 +142,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
} }
$additional_taxonomies = array(); $additional_taxonomies = array();
if (isset($news->category)) { if (isset($news->category)) {
$additional_taxonomies['ATOM Categories'] = array(); $additional_taxonomies['ATOM Categories'] = array();
$additional_taxonomies['ATOM Domains'] = array(); $additional_taxonomies['ATOM Domains'] = array();
...@@ -161,6 +158,7 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -161,6 +158,7 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
$additional_taxonomies['ATOM Categories'][] = "{$category['term']}"; $additional_taxonomies['ATOM Categories'][] = "{$category['term']}";
} }
} }
$title = "{$news->title}"; $title = "{$news->title}";
$body = ''; $body = '';
...@@ -185,7 +183,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -185,7 +183,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
} }
$author_found = FALSE; $author_found = FALSE;
if (!empty($news->source->author->name)) { if (!empty($news->source->author->name)) {
$original_author = "{$news->source->author->name}"; $original_author = "{$news->source->author->name}";
$author_found = TRUE; $author_found = TRUE;
...@@ -194,7 +191,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -194,7 +191,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
$original_author = "{$news->author->name}"; $original_author = "{$news->author->name}";
$author_found = TRUE; $author_found = TRUE;
} }
if (!empty($feed_XML->author->name) && !$author_found) { if (!empty($feed_XML->author->name) && !$author_found) {
$original_author = "{$feed_XML->author->name}"; $original_author = "{$feed_XML->author->name}";
} }
...@@ -217,7 +213,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -217,7 +213,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
else { else {
$item['guid'] = $item['url']; $item['guid'] = $item['url'];
} }
$item['geolocations'] = array(); $item['geolocations'] = array();
if ($lat && $lon) { if ($lat && $lon) {
$item['geolocations'] = array( $item['geolocations'] = array(
...@@ -228,7 +223,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) { ...@@ -228,7 +223,6 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
), ),
); );
} }
$item['tags'] = isset($additional_taxonomies['ATOM Categories']) ? $additional_taxonomies['ATOM Categories'] : array(); $item['tags'] = isset($additional_taxonomies['ATOM Categories']) ? $additional_taxonomies['ATOM Categories'] : array();
$item['domains'] = isset($additional_taxonomies['ATOM Domains']) ? $additional_taxonomies['ATOM Domains'] : array(); $item['domains'] = isset($additional_taxonomies['ATOM Domains']) ? $additional_taxonomies['ATOM Domains'] : array();
$parsed_source['items'][] = $item; $parsed_source['items'][] = $item;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment