This is an archived article to see the current version visit http://www.timothyfish.net/Article.asp?ID=37.
Whether the acronym stands for Really Simple Syndication (RSS 2.0), Rich Site Summary (RSS 0.91, RSS 1.0) or RDF Site Summary (RSS 0.9 and 1.0), RSS feeds can be very useful. A church website is one example of where they can be very useful. For a church website to be a good communication tool, there needs to be a way to get information to church members. Unlike some websites, church websites may change frequently during some weeks and on during other weeks they may have no changes at all. People might not have a reason to visit the site on a regular basis, so some people might miss information or only learn of it after it is too late. RSS can help solve this problem.
RSS can solve problems for both the end user and the webmaster. The end user can subscribe to the church's RSS feed and anytime there is information added to the website, the user will see it in his favorate RSS agregator. He may have been checking the news and there along with everything else is a summary of a new article on the church website. The webmaster may have a form that people are to fill out for some reason. The webmaster doesn't want to check the website everyday. There may not be anything there for weeks at a time, but when there is something he wants to know as soon as possible so he can take care of it. Rather than checking the website, he can set up a RSS feed and let the agregator check the website for him.
No doubt you think it sounds great, but you may be wondering how what it takes to do this. If you have created a website using the approach that is in the book then it couldn't be easier. Even if you haven't you should be able to get the general idea of how to create a feed. Below is the code that is required to make it work. All you have to do is add it to the bottom (after the <html> tag) of the EditAdd.asp file in the maintenance directory. As in the book, you will need to change the bold text to your own values rather than mine. With this code in place, everytime you add or update an article on the website, the RSS feed will be updated with a link to the article. The agrigator will recognize the new data and the users will be informed. The code is being used to produce the RSS 2.0 Feed for this site at http://churchwebsitedesign.timothyfish.net/rss.xml.
<%
Function WriteFeed
strPathInfo = Request.ServerVariables("PATH_INFO")
Set FileSys=Server.CreateObject("Scripting.FileSystemObject")
Set TStream=FileSys.CreateTextFile("C:\hshome\tdfish\churchwebsitedesign.timothyfish.net\rss.xml")
set conn = server.createobject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:\hshome\tdfish\churchwebsitedesign.timothyfish.net\cgi-bin\database.mdb"
TStream.WriteLine "<?xml version=""1.0""?>"
TStream.WriteLine "<rss version=""2.0"">"
TStream.WriteLine "<channel>"
TStream.WriteLine "<title>Church Website Design: A step by step approach</title>"
TStream.WriteLine "<link>http://ChurchWebsiteDesign.TimothyFish.net/</link>"
TStream.WriteLine "<description>Church Website Design Articles</description>"
TStream.WriteLine "<image>"
TStream.WriteLine "<url>http://www.timothyfish.net/images/authorphoto.gif</url>"
TStream.WriteLine "<link>http://churchwebsitedesign.timothyfish.net/index.asp</link>"
TStream.WriteLine "</image>"
Dim rs, ListQuery
ListQuery = "SELECT Article.Id, Article.Type, Article.Title, "&_
" Article.Author, Article.Date, Article.Approved, Article.Hits" &_
" FROM Article "&_
" ORDER BY Date DESC;"
Set RS=conn.Execute(ListQuery)
index = 0
DO WHILE NOT RS.eof
index = index + 1
rssTitle =
RS("Title") Note: If the title has tags in it then use a version of stripHTML
on Title
rssLink = "http://www.timothyfish.net/Articles/Article.asp?ID="&RS("ID")
rssDescription = "Posted by "&RS("Author")&", "&RS("date")&"."
TStream.WriteLine "<item>"
TStream.WriteLine "<title>"&rssTitle&"</title>"
TStream.WriteLine "<link>"&rssLink&"</link>"
TStream.WriteLine "<image>"
TStream.WriteLine "<url>http://churchwebsitedesign.timothyfish.net/Images/BookCoverSmall.gif</url>"
TStream.WriteLine "<link>"&rssLink&"</link>"
TStream.WriteLine "</image>"
TStream.WriteLine "<description>"&rssDescription&"</description>"
TStream.WriteLine "</item>"
RS.MoveNext
Loop
TStream.WriteLine "</channel>"
TStream.WriteLine "</rss>"
conn.Close
Set conn=Nothing
END FUNCTION
%>
<%WriteFeed%>