Adding an RSS Feed
If you have a site which has a lot of new content added on a regular basis then adding an RSS feed is a great way to not only get more people to view your content but also a way to generate more inbound links.
I have just created 2 RSS feeds for AnswerHero.co.uk:
An RSS feed is an XML based file in a specific format that is recognised by the plethora of RSS readers out there.
You can even use services like TwitterFeed to automatically post entries from your RSS feed into Twitter accounts!
Setting up the feed is fairly straightforward and involves writing out a header section and then looping through the required records and writing them to the feed.
RSS Header Section
If you look at the source of one of the feeds above you will see that the header section looks like this:
view 1000s of answers.
Everything in this section is hard coded except the LastBuildDate which is basically the current date.
Firstly you need to add this to the very top of the code: Response.Contenttype = "text/xml".
Next output the sections above until you get to the “lastbuilddate”.
I used the following ASP code to format the date using “now”:
response.write "
response.write left(weekdayname(weekday(now)),3) & ", " & day(now) & " " & left(monthname(month(now)),3) & " " & year(now) & " "
If Hour(now) < 10 then
response.write "0"
end if
response.write hour(now) & ":"'
If Minute(now) < 10 then
response.write "0"
end if
response.write minute(now) & ":"
If Second(now) < 10 then
response.write "0"
end if
response.write second(now) & " GMT"
response.write "
response.write "
response.write "
response.write ""
response.write "
response.write "
http://www.AnswerHero.co.uk"
response.write "
RSS Body Section
You then need to loop through as many records as you would like to go out in the feed, say 50, and write the following for each record:
response.write "
response.write "
response.write "
" & URL & "" & vbcrlf
vbcrlf
response.write "
response.write left(weekdayname(weekday((mid(rs("DateTime"),7,2) & "/" & mid(rs("DateTime"),5,2) & "/" & left(rs("DateTime"),4)))),3) & ", "
response.write mid(rs("DateTime"),7,2) & " " & left(monthname(mid(rs("DateTime"),5,2)),3) & " " & left(rs("DateTime"),4) & " " & mid(rs("DateTime"),9,2) & ":" & mid(rs("DateTime"),11,2) & ":" & mid(rs("DateTime"),13,2) & " GMT"
response.write "
response.write ""
response.write "
RSS Footer
Then finish of the XML with the footer:
Allowing Auto Detection of the RSS Feeds
You know when you go to some websites you get the little RSS logo appearing in the browser?
Well you achieve this by placing entries in the head section of your pages.
If you look at the source of the AnswerHero home page you will see the following:
It’s as simple as that!
Once you have created your RSS feed just do a search on Google for “rss feed directory” and you will find plenty of places for you to publicise your shiny new feed.












