Raw HTML in RSS feeds

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Raw HTML in RSS feeds

Post by Stosh »

Hi,

I seem to be having trouble getting raw html (such as embedded youtube videos) to show up in the RSS feed. Viewing the page source at the feed shows that the html is there, but that it has had its brackets and such converted into entities. Is there any advice you can share for making this work? My primary concern is getting the blog entries to properly link to facebook (videos and all).

Thanks if you can help.

-stosh
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Raw HTML in RSS feeds

Post by garvinhicking »

Hi!

HTML needs to be encoded inside RSS feeds, so that is actually allright!

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Re: Raw HTML in RSS feeds

Post by Stosh »

Garvin,

re: "HTML needs to be encoded inside RSS feeds, so that is actually allright!"

Yeah, I get that, but being encoded, it is no longer pulled in by the reading application. In this case the reading application is facebook, but even firefox just displays a big nothing there where the youtube video used to be.

My only idea is to simply include the facebook link as plain-text under the video, so that reading applications will, at least, get the link (facebook is actually nice enough to convert it to a link).

Strangely though, anchor links seem to come through just fine. A link to another article on the same blog came through and displayed on facebook. It may be that the "<object..." sequence is just considered too dangerous, and gets filtered... But why would it be missing in firefox listings of the feed as well?

I don't know.

Well, if you have any better suggestions than my: "plain-text-link" idea, let me know.


-stosh
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Raw HTML in RSS feeds

Post by garvinhicking »

Hi!

Basically it should work fine. What's your RSS feed address, and can you show a page where you use the RSS feed and where it doesn't display?

If you want to manually adjuts things, you can put the feed*.tpl files into your custom template directory and edit them there. There you could also insert fixed text/links into the feed, if you like.

And yes, many RSS display clients filter out object tags. You could check your own feed in Google Reader for example, Google Reader does display object tags. If your feed render fine there, and not in another app, it's not working due to the other app, not due to your feed.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Re: Raw HTML in RSS feeds

Post by Stosh »

Garvin,

Thanks for your help in at least understanding what's going on.

Re: "What's your RSS feed address"

Here's my 2.0 RSS link: http://standoutpublishing.com/Blog/inde ... index.rss2
(drop back to blog for the front page that includes videos)


If you simply view it in a firefox browser, you will see that the videos are missing. However, if you view-source on that you will see the object tags in there (with entity encoding).

For a time I noticed that the videos were surrounded by content:encoded /content:encoded tags.

AHA!

... but no. anything with HTML overhead, such as links, are also surrounded by the same tags and the links display fine.

This seems to be getting down to filtering by the reading apps... But filtering in the firefox browser? That doesn't seem right.

-stosh
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Raw HTML in RSS feeds

Post by garvinhicking »

Hi!

The RSS rendering of Firefox AFAIK disables active elements, such as Plugins (Flash) and Javascript. It only renders "pure" HTML, due to security concerns.

The code of your posting is just fine! If Apps displays that unfiltered, all would be well.

Check out feeds of other sites with embedded video like http://www.fuenf-filmfreunde.de/feed/ -- FF does not parse the full HTML set.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Stosh
Regular
Posts: 75
Joined: Mon Oct 12, 2009 11:47 pm

Re: Raw HTML in RSS feeds

Post by Stosh »

Thanks Garvin,

I'll simply include an anchor out to the video site in my posts along with videos, in order to accommodate vigilant feed-reader applications.


-stosh
onli
Regular
Posts: 2830
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Raw HTML in RSS feeds

Post by onli »

I noticed that even when using google reader, video from my blog are not shown, e.g. this entry (which is easily findable in the feed, since it's the second entry at the moment). In feeds from other sites, the videos are shown, e.g. that video on ascene.

So maybe there is really something going wrong on the side of serendipity?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Raw HTML in RSS feeds

Post by garvinhicking »

Hi onli!

That's strange. The HTML markup really looks okay to me. I wouldn't know what's wrong on the page...maybe google reader chokes on "content:encoded".

Maybe you can add a feed_rss3.0.tpl template file, use the rss2.0 as a basic template, and then instead of content:encoded with escaped HTML, use a "description" tag, complete with <![!CDATA[...html...]]>?

Or, try to use the CDATA-markup with unescaped HTML inside content:encoded?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
onli
Regular
Posts: 2830
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Raw HTML in RSS feeds

Post by onli »

Tried the CDATA-approach in content-encoded and in description, no effect (although the description-approach may need some time to be refreshed in google reader), using this feed

What I don't get: Where is the <!-- xhtml clean youtube -->...-Part coming from? It's definetely nothing I inserted, and if that's what the reader sees it's clear that is the issue since only the embed-tag is supported by it. Is it the xhtml-cleanup-plugin?

Edit: Seems to be that way. Deactivating the youtube-option in the plugin, chrome now is able to play the video in the feed. The next cache-cleanup of google reader will reveal the effect on it.
onli
Regular
Posts: 2830
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Raw HTML in RSS feeds

Post by onli »

Jop, that's it. The youtube-xhtml-markupoption hinders the google reader to show embedded videos. We should disable that option by default and update its description or remove it altogether :)

Thanks Garvin.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Raw HTML in RSS feeds

Post by garvinhicking »

Hi!

Hm, I believe this option was added in the past because the default youtube is not XHTML compliant. I'm not youtube-proficient enough to spot what inside the markup is incompatible with the RSS feed, maybe this can be worked out somewhen.

for the time being, I followed your advice and disabled it by default...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
onli
Regular
Posts: 2830
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Raw HTML in RSS feeds

Post by onli »

It's the embed-tag. Thrown out of xhtml , google reader relies on it.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Raw HTML in RSS feeds

Post by Don Chambers »

onli wrote:It's the embed-tag. Thrown out of xhtml , google reader relies on it.
That totally sucks! :evil: <embed> is not now, nor has it ever been, a valid tag. It was invented by Netscape. Shame on google reader!!!! :x
=Don=
Post Reply