In trying to simplify the contents of the feed, the parser_simplepie module inadvertently(?) strips out information such as media RSS, GeoRSS and any other enclosures to a feed. I've come across this issue while trying to use the FeedAPI mapper module to map some of this extra information into fields.

CommentFileSizeAuthor
#8 parser_simplepie.module-raw_item.patch918 bytesdubitable

Comments

geodaniel’s picture

Title: Non-basic feed elements stripped out in parser_simplepie_simplify_raw_item() » Extra information (e.g. enclosures, location) missing from SimplePie feeds

Perhaps I'm off base here... From looking at the code, it appears as though support for enclosures has not been added to the SimplePie parser in 6.x (despite #228111: Add enclosure (and location) support to FeedAPI Drupal 6 being closed out) as it was in 5.x. I've re-opened that issue.

Should get_latitude and get_longitude support also be added directly into the SimplePie parser in the same way?

geodaniel’s picture

Status: Active » Closed (works as designed)

Ok, please ignore this issue. I've updated #228111: Add enclosure (and location) support to FeedAPI Drupal 6 and #265196: Support for the Location module with patches that re-add enclosure support and also location support.

geodaniel’s picture

Title: Extra information (e.g. enclosures, location) missing from SimplePie feeds » SimplePie Parser: raw information missing from feeds
Status: Closed (works as designed) » Active

I am actually going to re-open this as I believe the raw information should still be passed through to other modules but at present the simplification function (parser_simplepie_simplify_raw_item) strips this information out. Is it intentionally stripping the raw information out, or should it also include a simplified version of the raw information?

I'm interested in this to be able to extract xCal information (as well as the location information, which I provided a patch for in #228111: Add enclosure (and location) support to FeedAPI Drupal 6.

Arto’s picture

Subscribing.

summit’s picture

Hi,

Would very much know how to get the location_mapper working. Subscribing,
greetings,
Martijn

Krummrey’s picture

I think having acces to all elements within a feed would be great. Not all feeds adhere to certain standards. Especially when you get to things like mediarss and georss. So having all the information contained in the feed and mapping it out later would be great.

aron novak’s picture

Status: Active » Postponed (maintainer needs more info)
// Stick the raw data onto the feed item.
$curr_item->options->raw = $simplepie_item->data;

As I see the parser_simplepie_simplify_raw_item() is never called. (it should be removed btw. but it's a different story)
What simplepie parser can do in order to extract xCal info?

dubitable’s picture

StatusFileSize
new918 bytes

Hi Aron, it seems like this function is indeed being called (not that I can grasp where...sometimes I find Drupal so freaking opaque...), as my modification has allowed me to import more than just the values for elements that are inside of the 'child' sub-array. Not sure if this is dangerous though; is there a particular reason that this line


if ($item = array_shift($raw_item['child'])) {

...just pulls the one array out? There is more data in there...

Anyways, patch attached. It allowed me to map fields to the non-standard RSS elements in the RSS feed I'd created (I used namespace http://web.resource.org/rss/1.0/modules/event/ to be exact). Not sure if it'll make other elements from other namespaces show up but based on my reading of the SimplePie API, it should.

summit’s picture

Component: Code » Code parser_simplepie

Hi,
Trying to get information other than lat/lon on location fields, possible mapping non-standard RSS elements: (http://drupal.org/node/333519#comment-1143948).
Greetings,
Martijn

alex_b’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Needs review

#8: This looks like a good suggestion to me. Code needs review.

AntiNSA’s picture

Im trying to use geotagging embedded in feeds from yahoo pipes which included the marker on the map for each rss feed... Do I need to apply this patch? Also using feedapi and feedapi mapper..

Thanks for your help-

Robert

liberatr’s picture

Just now using Simplepie with Feed Element Mapper on a valid podcast feed, my oprions->raw->enclosure was getting passed an array, not the URL I expected.

I employed the following hack to get to the URL:

<?php
function parser_simplepie_simplify_raw_item($raw_item) {
.
.
  $simple_item[$k] = $item[$k][0]['data']; // in the case of enclosure, this is empty
  if($k == 'enclosure') {
    $simple_item[$k] = $item[$k][0]['attribs']['']['url'];
  }
.
.
}
?>

Yes, it was really stored in an array key with an empty string. Is this a Simplepie problem?