What is RFC 822:
RFC 822 refers to the standard that governs the format that e-mails are required to be sent in. Dates in the e-mail header are required to be formatted in a certain way.
The people who wrote the standards for RSS opted to refer to the RFC 822 standard for the format of the date instead of specifically defining the date format required themselves.
In summary, if you want your RSS Feed to validate, your dates must be in RFC 822 format.
RSS Feed Resources:
I used the following script (modified, of course) to create the RSS feed.
http://aspdevstudio.servemp3.com/aspdevstudio/article/article.asp?aid=18 - http://aspdevstudio.servemp3.com/aspdevstudio/article/article.asp?aid=18
This was a good starting point to build on. I had to change the connection and query since I was using MS SQL and not Access, and then I had to add the fields for the dates.
Only one problem: the script above does not put the dates in it! And they are required to be in a certain format.
So I looked around the net and found a function that converts a date in ASP to RFC 822 format. I used it in my script and it worked well without me having to modify a thing.
http://www.expertsforge.com/Web-Development/Tutorial-47.asp - http://www.expertsforge.com/Web-Development/Tutorial-47.asp
Then I wanted to get more creative and add more fields.
If found a great website that explains all the tags:
http://www.make-rss-feeds.com/ - http://www.make-rss-feeds.com/
and used that to add the fields I wanted to the RSS feed that weren't included in the original script I used as a base.
With those three resources, copying & pasting my existing connection string from other working code, and defining an appropriate query, I was able to make a working RSS feed.
http://www.caribbeanchoice.com/rss.asp - http://www.caribbeanchoice.com/rss.asp
The above feed was generated using the code I made.
Also, you will need to validate your feed:
http://validator.w3.org/feed/ - http://validator.w3.org/feed/
Additional Features:
Since the feed it data driven, some enhancements that I plan on adding are:
- Being able to pass variables to it in the URL to define what content is delivered in the feed. That way I can use one script to generate all the feeds on the site. Specifying no arguments will result in the default feed being served.
- Logging accesses to the script so I can get a good idea of how often it is used. I know this won't give me detailed stats, but it would be nice to know at least some basic info about what readers and services are accessing it. This may not be worth it, but I'd figure I'd try it.
Another thing that this is missing that would be required for very busy sites is caching. It would be nice if it cached the feeds as an XML file so that a database query wouldn't be needed every time someone accesses the RSS feed. I haven't found a good sample script that does that though.
In Closing:
I hope that helps. I could still give you the exact code I used, but since you would have to hack it yourself to get it to do what you want, I thought it would be better to give you the actual resources and sample code I used. If you still want my code, I can provide it as well.
P.S. It took me many months to gather all the information required to make an RSS feed. (A lot of the information out there wasn't useful or inthe wrong scripting language.) So don't lose this.
