Dale's Weblog

looking back it was easy.
Friday 12 March

RSS Formatting

Posted by dale on Thu, 28 Oct 2004 15:38:29 EST

My RSS was a touch dodgy (well it still is dodgy but it is better), it never used to format things, like new lines and urls etc.

Simple fix needed to wrap the content around <![CDATA[ content here ]]>. So yeah, formatted RSS. Funky. ;)

Below are the comments for this news item

Watch out, your comments RSS doesn't work great in my reader of choice. I haven't validated, etc. but who knows… take a look at it?

1: Comment by Josh - Thu, 28 Oct 2004 18:33:22 EST


Seems to be working here fine.

http://feeds.archive.org/validator/check.cgi?url=http%3A%2F%2Fblog.dalegroup.net%2Frss2-comments.php

Working/Not working for anyone else?

2: Comment by dale - Thu, 28 Oct 2004 19:31:57 EST


<content:encoded> <p>encodedcontent
</p>
</content:encoded>

My feedreader is displaying "encodedcontent" for each item – for fairly obvious reasons. Looks like it's kinda un-dynamic…

Either ditch the content:encoded altogether, or fix it up… preferably fix it up:P

3: Comment by Josh - Thu, 28 Oct 2004 21:33:04 EST


Cool, fixed. Thanks!

4: Comment by Josh - Thu, 28 Oct 2004 21:46:22 EST


I've used <!CDATA ever since I started publishing my own RSS feeds. It seems to be the only way to do it.

I have HTML in my database - <p> tags mainly - so how else would I do it?

It seems to work fine, so no bother.

5: Comment by Matthom - Thu, 28 Oct 2004 23:16:46 EST


Uhoh. Matthom mentioned <!CDATA in your post, which broke stuff… encode HTML entities!!! &lt; is your friend ;)

6: Comment by Josh - Fri, 29 Oct 2004 09:05:36 EST


Sorry about that people. I left a $ off the first time and didn't run htmlspecialchars the second time (note htmlentities is bad, stuffs up validation, htmlspecialchars is good!).

Yeah Matt that seems to be the only way to do it. Will look into it.

Both RSS feeds may not be perfect for a while, need to place around with them.

7: Comment by dale - Fri, 29 Oct 2004 09:15:49 EST


Yes, I should have used the proper entity… My bad. I figured Dale would have a script to check for tags, and automatically convert them to their appropriate character encoding.

Much like the &#60;p&#62; tag….

8: Comment by Matthom - Fri, 29 Oct 2004 11:27:51 EST


Hmmm, my encoding didn't work properly. I used the straight ASCII encoding. Let's see if this one works:

&lt;p&gt;

9: Comment by Matthom - Fri, 29 Oct 2004 11:28:41 EST


Yep I do checking, although I left it off on the RSS feed when I changed it. Everything is working now. Type normal stuff ;)

10: Comment by dale - Fri, 29 Oct 2004 12:13:49 EST


BBCode:

urls become clickable

[b]place text in bold[/b]

[i]place text in italics[/i]

[quote]place text in a quote[/quote]

Comments? Please note that all HTML tags are removed from your post.

The URI to TrackBack this entry is: http://www.dalegroup.net//early05/archive/blog/newsid/trackback/176

Comments

Message:

Name (optional):

Email (not shown):

WWW (optional):






Copyright © Michael Dale 2004. Page generated in 0.0081 seconds FreeBSD Powered
Background on style 5 is used from squidfingers How are we going? 3 queries