FeedAPI + Flickr: Is there a guide?

Events happening in the community are now at Drupal community events on www.drupal.org.
mattmm's picture

I'm wondering if there is a comprehensive guide for configuring FeedAPI and Flickr to pull in Flickr feeds to create thumbnails that link to content/nodes. Thanks in advance!

Comments

FeedAPI Handbook is a start

cglusky's picture

You can find it here http://drupal.org/node/326601. It has some good info. There are some tutorials at the end but not sure they will address your use case with Flickr. I have done it as a test of the embedded image media field patch that was recently rolled into the development version of Feed Element Mapper. Not sure if it's been committed to the latest stable release. Anyway, here is my test feed in D6 http://d6.metanomy.org/?q=feed-item/63

You will need (I am running all the latest dev versions in Drupal 6.6):
-FeedAPI
-Feed Element Mapper
-CCK
-Embedded Media Field
-SimplePie if you are not on PHP 5 (or you just want extra features)
-Views if you want to customize the output into something like a gallery.

This really needs to go in a tutorial and or handbook page so here's the short version:
-Once you have all the stuff above installed and enabled you can start having fun...
-Create a content type that can be used as a feed item - Call it Flickr Items if you like but anything will do. FeedAPI can parse your feed and create nodes using this content type. It should not be marked as a FeedAPI content type - that's only for parent feeds; you are creating a content type that FeedAPI will use to create nodes.
-Save It.
-Goto Manage Fields tab and add an embedded media field (of the image variety) to hold your Flickr photo. Make sure you have configured embedded media field to allow Flickr content (under Admin). This field will be used later to map the feed item.
Save It.
-Goto Dispay Fields tab and select how you want the teaser and node image to be handled. In your case something like thumb with link to original.
-Now you are ready to try a feed. I used an RSS from a channel, but I would think about any would do. Go to Create Content and add a Feed. Fill in the Title and url for the feed - the body will be automatically populated with some RSS info. Under the FeedAPI processor settings point it at your Flickr Item content type. You are telling the Feed to create Flickr Items as nodes when processing the feed.
-Save It.
-Goto the Map tab. Under Description of available mappers you should see something like this "field_emimage (emimage module)"; if you don't somethings not right. Go back and check my confusing instructions against your reality.
-If you do see it then woohoo! Go down a bit further and you should be able to see options->original_url: and a drop down. In that drop down you should be able to map that sucker to your embedded image media field.
-Save It.
-Now you should be able to hit Refresh and the feed will be parsed/processed and a bunch of new Flickr Item nodes created.
-Enjoy
-Optionally you can get into Views and create galleries etc.
Note: If you are running PHP 5 you can use Common Syndication Parser but you may want to try SimplePie as it has a bit more features. BUT Common Syndication Parser should be enough to get the fields you need for Flickr. The cool part is if you run SimplePie you might be able to get the geo tags from the GeoRSS feed and map them to Location, but that's another tutorial.

Hope that helps!
Regards,
Coby
Metanomy.org

This is some great

mattmm's picture

This is some great information! I will make a screen cast once I get this working. However, I'm running into 2 issues.

Frist, when I try to process the feed through my custom CCK page - the "FlickrImages" page dosn't display in the drop down of the create feed form. The only options that appear are "Page" and "Story"

Second, I've added the emfiled image field into the default "Page" content type. Even when parsing my flickr group - mapped tot he original_url like above - I don't see any thumbnails generated. I've cleared cache a few times, recreated and nothing.

I am using the dev version of the embedded media field - do I need to use dev version of FeedAPI as well? Thanks for your great explanation this far.

I'm going to have one of our

alex ua's picture

I'm going to have one of our developers work on this in the upcoming week, so please check back later for updates.

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

is there a bug or does it

mattmm's picture

is there a bug or does it simply not support flickr?

I am running all dev versions

cglusky's picture

mattmm,
I was running all the latest dev versions when I did my test. Sorry, can't remember anything more that I did. I really need to keep better notes. It does work as you can see from the link above. If you go to your Feed and go to Map what do you see for Feed item example? It's right above Description of available mappers. You should see a link to the image in the original URL. As far as the other stuff not working...

-Make sure you have permission to create/edit/view both the content type and the cck fields.
-Make sure you have embedded media field set up for Flickr. I believe I had to give it an API Key despite reading someplace that one was no longer required.

Sorry, it's a bit fuzzy.
R,
C

It would be more than

alex_b's picture

It would be more than awesome if new lessons learned would find their way into the FeedAPI handbook: http://drupal.org/node/326601

http://www.twitter.com/lx_barth

You Are Correct

cglusky's picture

This needs to be brought into the handbook. I am hoping mattmm can confirm my steps and then I can cut/paste/edit some of this into handbook.
R,
Coby

I'm getting closer...using

mattmm's picture

I'm getting closer...using all dev versions for said mod's. I'm running this locally on MAMP. I've managed to select my CCK content type when creating the feed - but I'm not getting any thumbnails or any images for that matter. The feed creates the nodes, with the text content - but nothing on images...

Maybe I'm wrong with pulling

mattmm's picture

Maybe I'm wrong with pulling an RSS feed from a group? I subscribed to a group and used the RSS link at the bottom. Maybe this isn't the right thing to do? Flickr isn't my specialty. Furthermore, I did confure my API keys in this experiment as well.

cancel that, just tried with photobucket, picasaweb and imageshack with no luck. Is there any image manipulator i should have that actualy creates the thumbnails?

I'm getting closer...using

mattmm's picture

I'm getting closer...using all dev versions for said mod's. I'm running this locally on MAMP. I've managed to select my CCK content type when creating the feed - but I'm not getting any thumbnails or any images for that matter. The feed creates the nodes, with the text content - but nothing on images...

Please check your permissions

cglusky's picture

Under Administration>>User Management>>Permissions. If you are not running as User 1 you will need to add permissions to your Flickr Item content type and your embedded media field if you have per CCK field permissions enabled.
R,
C

I am running as user1 -

mattmm's picture

I am running as user1 - maybe i should recreate using a non-su

Shouldn't matter

cglusky's picture

check your "Display fields" settings in the Flickr Item content type and make sure the teaser is set to "Image Thumbnails". I don't think default worked for me.

Requires Dev versions

blakehall's picture

Have you set up a flickr API key and entered it on admin/content/emfield > Embedded Image Field > Providers > Flickr Configuration?

After doing that, this walk-through was successful for me.

Hold off a few days...

alex ua's picture

We're in the process of implementing a new system for handling images in emfield, including making feedapi work a little more seamlessly with emimage. We should have something released by Thursday, though it may not have all the functionality yet, but either way I think you're wasting your time trying to work around a feature we're about to improve.

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

That's great to

mattmm's picture

That's great to know!

@blakehall - Yea I included the Flickr key - re-ran the entire process on my server vs my MAMP install and still get no images. I'll just wait for Alex and his hardworking staff! ;)

Filter Videos

cglusky's picture

Alex,
Sounds excellent. Would be interested to see how your handling videos in the feed as well. One of the problems I had was handling Flickr videos in a feed. FeedAPI would bring them in but no thumbnail.
R,
C

Not to rush, though, any

mattmm's picture

Not to rush, though, any movement on this?

Already works...

alex ua's picture

Sorry, I didn't realize last week that a mapper for emimage already works! http://drupal.org/node/326083

The instructions to do this are the exact same for mapping emvideo feeds, as can be found in the handbook here: http://drupal.org/node/246265

It shouldn't take more than 10 minutes to get this up and running...

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

still struggling with this

mattmm's picture

still struggling with this and have followed step by step...

i can provide an admin u/p to someone who would want to lend a hand looking at my settings...

fire away

cglusky's picture

since it was my steps that got you into this let's see if we can't get'r working

cglusky@drupal.org - best

mattmm's picture

cglusky@drupal.org - best means to email you?

that or you can use

cglusky's picture

coby /at/ [deleted to keep the spammers away]

Seems to depend on what emimage can handle

cglusky's picture

We got mattmm running but could not use his Flickr feed from a group pool. I have not looked very hard at emimage docs to see whether supported feeds are listed.

But we know from testing that these feeds are supported:

-photos from a photo set
-photos containing a tag (via Explore/Tags)

Not sure what other feeds it can handle.

R,
Coby

Yea, seems I couldn't use

mattmm's picture

Yea, seems I couldn't use that the way I wanted to...thanks coby for taking the time to check it out!

No Problem

cglusky's picture

And I forgot to add that FeedAPI Views integration provides a nice default feed item page. Without it its a bit of a pain to see your list of feed item nodes.

What is usually the symptom

mattmm's picture

What is usually the symptom when there is no image field to map under the map view of a feed?

Probably a regex issue

alex ua's picture

Assuming that flickr's api supports this type of request, I'm guessing that this is some sort of parsing error, which could be coming from the mapper, but is most likely coming from the emfield provider file. A quick search brings up this issue, and a patch for 5: http://drupal.org/node/281628 . I haven't tried it out yet, but we're doing a bunch of work on emfield right now so if nobody else ports it to 6.x first, we'll get to it next week...

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Alex Urevick-Ackelsberg
ZivTech: Illuminating Technology

Pool Feed Has The Info

cglusky's picture

When we were testing matt's setup the Atom feed from a Flickr pool had the image URL but the mapper could not get to it. Last I checked there were a few patches floating around that helped FeedAPI support drill down into RAW data and enclosures in a feed but have lost track of status. Too many things going on and I am not an XML feed expert. I did get a chance to make my own parser to handle a special use case so know it could be done. Just need to get the parser to loop deep enough into the right arrays and pass that data to mapper. In this case it's the image array in the pool feed I believe. The url to the image is there just not made available to the mapper because it's about two levels deep. And then I am not sure emiamge would like the url that is there.

Sorry to the Group here. This thread turned into something that's probably better placed in an issue queue.

On that note - Matt, if you are still having specific tech issues we should move over to the Feed API and/or Mapper queue with detailed issues.

R,
Coby

Yea there is still something

mattmm's picture

Yea there is still something weird going on. Seems on my production site, I can't get any fields to show up to be mapped. Probably something wrong with my emfield module, I will reinstall and see if that fixes anything.

PHP 5 vs. PHP 4

boris mann's picture

If you're having trouble with mapping fields showing up, check if you're running PHP 4 or PHP5, and if you're using the common parser or the downloaded mapper.

A lot of this pain will go away once everything on the hosting side gets upgraded to the newest version of PHP 5. I think you need at least PHP 5.2.6....

Hey Borris, thank for taking

mattmm's picture

Hey Boris, thanks for taking the time to respond.

This particular site is running on PHP 5.2.5 - I run the server so maybe the push to 5.2.6 will solve this tricky issue.

Hello all, I was wondering

patchak's picture

Hello all, I was wondering if it's possible to do the same thing, but using imagecache so i can have thumbnails the way I need them. I'm building a small site for the bike messenger company I work for and I would love to grab all flickr content from everybody, but the flickr thumbnals break the layout.

see : http://velocite.ch/10ans/photos as you can see there, some pictures are "higher" than others cause they are vertical, and this is not good cause I want to use a bigger thumbnail size and it creates a lot of whitespace.

So my idea was to see if it's possible to feed flickr rss items directly into an image field that would in turn use imagecache to create derivatives...

Is there any chance this could work? Anyone ever tried that??

Thanks,
Patchak

Flickrsync will solve that

budda's picture

To use imagecache n the files they need to be sucked down from flickr.com to your server. That's possible using http://drupal.org/project/flickrsync rather than FeedAPI / Atom.

Of course, you are then responsible for the bandwidth when serving the images!

Quick update with where I'm

mattmm's picture

Quick update with where I'm at. On my production site, it seems upgrading to the following recently released modules has worked:

FeedAPI 6.x-1.5
Embedded Media Field 6.x-1.x-dev (2008-Nov-20)
Feed Element Mapper 6.x-1.0-beta3

The only issue is, not all of the nodes created by the feed are displaying images. When i run the feed, it populates 20 items. However, only 9 of the items actually has populated a thumbnail from flickr. So this is a start in the right direction.

Can I ask how people forumulate their flickr rss links? It's possible I'm not doing it right like I did when i first started by using groups - now using tags.

I'm using: http://api.flickr.com/services/feeds/photos_public.gne?tags=SEARCH-TERM-...

Beautiful

tedkulp's picture

This worked perfectly. Thanks!

RSS & Aggregation

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week