Forum | RSS images as enclosures

You must be logged in to post Login

RSS images as enclosures

UserPost

2:47 pm
November 10, 2009


Chris Ullyott

Fullerton, CA

Member

posts 66

Yayuh! We're developing an iPhone app, but the app requires that the images in our RSS feed be enclosures, including the <enclosure> tag. Any plugin ideas to convert RSS image src links to enclosures?

Thanks a bunch,

Chris

Chris Ullyott | Daily Titan, CSU Fullerton | cullyott@dailytitan.com

6:40 pm
November 10, 2009


Daniel Bachhuber

Admin

posts 102

Excellent question, Chris! Thanks for posting it. I think the ideal approach would be to build a small custom plugin that allows you to add either images in the post or images in a custom field as enclosures to an RSS feed. An additional option would be that it generates its own custom RSS feed so that you don't necessarily have to include the images as enclosures in the primary feed. I'd go the route of building a plugin versus customizing the RSS templates in WordPress because the RSS templates are a part of the core files and will be overwritten every time you upgrade.

I suspect your next question is: how do I build a plugin? Thanks to Miles, you won't have to start from scratch. There's another plugin in the directory that you can use as a foundation. If I were you, I'd download that and then watch this video about building your first plugin. I suspect you'll only need to do a few modifications to get it where you need it. Feel free to ask any specific questions you have about this process.

9:13 pm
November 10, 2009


Chris Ullyott

Fullerton, CA

Member

posts 66

We'd be interested making this convert the post images themselves into enclosures if possible, so that our writers do not have to go through an extra step. We'd have to keep them in the original feed as well. Is this possible with a plugin?

Chris Ullyott | Daily Titan, CSU Fullerton | cullyott@dailytitan.com

11:32 pm
November 10, 2009


Daniel Bachhuber

Admin

posts 102

It is certainly possible with a plugin. The approach I would take would be to search the post content for the first <img> tag, and then put the source value of that as the enclosure.

7:00 pm
November 12, 2009


Chris Ullyott

Fullerton, CA

Member

posts 66

Thanks I'll get started.

Chris Ullyott | Daily Titan, CSU Fullerton | cullyott@dailytitan.com

2:13 pm
November 13, 2009


Chris Ullyott

Fullerton, CA

Member

posts 66

The approach I would take would be to search the post content for the first <img> tag, and then put the source value of that as the enclosure.

Do you mean that this is what the plugin would do? I am a little lost.

Chris Ullyott | Daily Titan, CSU Fullerton | cullyott@dailytitan.com

9:17 pm
November 13, 2009


Chris Ullyott

Fullerton, CA

Member

posts 66

Hmm, I'll have to look into this further when I have more time. However—the original plugin recommended by Daniel, called WP RSS Images by Alain Gonzalez did the trick for us. What it does is, with every post with a picture, it kind of duplicates that picture but adds it into the post as an enclosure. So, in the feed, you see an image file, but the picture does not display.


We needed this so our iPhone app could pull the image files (it could not deal with the normal <img src> tags.

Chris Ullyott | Daily Titan, CSU Fullerton | cullyott@dailytitan.com


About the CoPress forum

Most Users Ever Online:

119


Currently Online:

5 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 107

Posts: 538

Membership:

There are 151 Members

There have been 2 Guests

There are 5 Admins

There is 1 Moderator

Top Posters:

Chris Ullyott – 66

Mo Jangda – 35

arobinsonwku – 32

laurenmichell – 21

CMLife – 16

sbressler – 15

Administrators: Daniel Bachhuber (102 Posts), William P. Davis (65 Posts), joey (39 Posts), Greg Linch (14 Posts), adam (1 Post)

Moderators: Andrew Spittle (49 Posts)