Nutshell: We're trying to map Flickr RSS feeds to CCK image fields.

Background to Problem: We're using the image mapping patch here:http://drupal.org/node/224235#comment-965647 to map incoming image feeds' images to CCK image fields. (Using simplepie also.)

PhotoBucket Feeds have a "raw->guid" field which contains a .jpg link to the image - this field appears as a mappable field in the feed mapper, and when mapped to the CCK image field everything works fine:

Array
(
[title] => Salford Triathlon
[description] => worsles posted a photoSalford Triathlon - DSC00410.jpg
[options] => Array
(
[original_url] => http://s458.photobucket.com/albums/qq309/worsles/General/?action=view&cu...
[timestamp] => 1228489215
[guid] => http://i458.photobucket.com/albums/qq309/worsles/General/13072008006.jpg
[original_author] => Array
(
[name] => worsles
[link] =>
[email] =>
)

[tags] =>
[domains] =>
[raw] => Array
(
[title] => Salford Triathlon
[link] => http://s458.photobucket.com/albums/qq309/worsles/General/?action=view&cu...
[description] => worsles posted a photoSalford Triathlon - DSC00410.jpg
**** [guid] => http://i458.photobucket.com/albums/qq309/worsles/General/DSC00410.jpg ****
[pubDate] => Fri, 5 Dec 2008 08:43:39 MST
)

)

)

Problem: Flickr fields have no such field - the closest to what we need appears to be the ['options']['enclosures']['image']['jpeg'][0]['link'] value (!!!):

Array
(
[title] => P1090266
[description] => MeRyan posted a photo:

[options] => Array
(
[original_url] => http://www.flickr.com/photos/davidrhscott/3120438228/
[timestamp] => 1229686469
[guid] => tag:flickr.com,2005:/photo/3120438228
[original_author] => Array
(
[name] => MeRyan
[link] => http://www.flickr.com/people/63457916@N00/
[email] =>
)

[enclosures] => Array
(
[image] => Array
(
[jpeg] => Array
(
[0] => Array
(
[bitrate] =>
[captions] =>
[categories] =>
[channels] =>
[copyright] =>
[credits] =>
[description] =>
[duration] =>
[expression] =>
[framerate] =>
[handler] =>
[hashes] =>
[height] =>
[javascript] => js
[keywords] =>
[lang] =>
[length] =>
***** [link] => http://farm4.static.flickr.com/3066/3120438228_bd14331538_o.jpg *****
[medium] =>
[player] =>
[ratings] =>
[restrictions] =>
[samplingrate] =>
[thumbnails] =>
[title] =>
[type] => image/jpeg
[width] =>
)

)

)

)

[tags] => Array
(
[0] => public
[1] => astronomy
)

[domains] => Array
(
[http://www.flickr.com/photos/tags/] => Array
(
[0] => 0
[1] => 1
)

)

[raw] => Array
(
[title] => P1090266
[link] => Array
(
[0] =>
[1] =>
[2] =>
)

[id] => tag:flickr.com,2005:/photo/3120438264
[published] => 2008-12-19T11:34:31Z
[updated] => 2008-12-19T11:34:31Z
[content] => MeRyan posted a photo:

[author] =>

[category] => Array
(
[0] =>
[1] =>
)

)

)

)

This field does not appear as a mappable option when you go to the feed > map page. The mappable options are:

options->enclosures->image->jpeg
options->enclosures->image
options->enclosures

So it seems that the mapper drills down into arrays to offer up mappable fields - but not far enough in this case?

Question 1: Has anyone managed to get Flickr feeds to map to CCK image fields? If so - what am I missing??? :O
Question 2: Failing that - how would I get that value to be listed as a mappable element?

Any help would be much appreciated! :)

Comments

alex_b’s picture

Title: Flickr Issues mapping to Image Field » Flickr: JPG path not exposed
Project: Feed Element Mapper » FeedAPI
Version: 5.x-1.0-beta7 » 5.x-1.x-dev
Component: Code » Code parser_simplepie
Status: Active » Postponed (maintainer needs more info)

This is a parser related problem. Which parser are you using? I assume it's parser_simplepie. You could submit a patch that exposes JPGs that come from flickr.

hoza’s picture

Ah! After days of researching and looking and reading and head-bashing-on-keyboard, I finally find this thread with someone having the exact problem I'm having!! Woot! (Misery loves company and all that.)

Has a solution been found for this that anyone could post? I've been suspecting the parser for a while, but any changes I tried have bore no fruit. For one, I went through the SimplePie bits for FeedAPI and removed all the simplification code for stripping out "raw" elements. The only thing that happened was there was a ton of extra stuff exposed to Feed Element Mapper, but still could not get access to anything that is down in a path past a "[0]", as stated in ecoluke's post. For me, the feed I'm trying out has a few spots like that, where the path is accessible up until the point of the "[0]", but no further.

I'm currently confused about how it could be a parser issue, since the feed data all shows up on the FEM "Map" tab for the feed in Drupal. If it's getting that far, isn't it being parsed to that point? If the data is visible in that page, it should be accessible to FEM, correct?

I'm currently toying with learning more about making my own mapper, but to be honest, it's been stumping me a bit. I'll keep plugging, but please post any info that might shed more light on this? Anyone? Beuller?

Thanks.

ghumpley’s picture

Subscribe - I'm having the same issue.

ryanc’s picture

I'd suggest Yahoo Pipes perhaps. You can just create the equivalent of guid element for Flickr yourself.