ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Intro to ASP



 
French Wedding


Coding a RSS Feed - Header



It is very easy to use ASP to create a dynamic RSS feed that updates whenever you add fresh content to your site. This page helps you get the top - or header - part of the RSS file set. This is going to be the same for pretty much any RSS feed you create.

First, make sure you've set up a RSS reader to test your feed, and that you've read about the basics and printed out the sample. Those will be important so that you can test your output.

Now it's simply a matter of coding a file that is FILENAME.RSS that is set up to display your 3 latest articles or blog entries in proper RSS format.

First, the standard top area. You barely even need ASP for this part - just to put the current date into the appropriate spot.

<rss version="2.0">
<channel>
<title>YOURSITETITLE</title>
<link>YOURURLLINK</link>
<description>YOURDESCRIPTION</description>
<language>en-us</language>
<copyright>YOURCOPYRIGHT</copyright>

<%
CurrDate = Now()

CurrHour = Hour(CurrDate)
if CurrHour < 10 then CurrHour = "0" & CurrHour
CurrMin = Minute(CurrDate)
if CurrMin < 10 then CurrMin = "0" & CurrMin
CurrSec = Second(CurrDate)
if CurrSec < 10 then CurrSec = "0" & CurrSec

CurrDateT = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & _
MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & _
CurrHour & ":" & CurrMin & ":" & CurrSec & " EST"
%>
<lastBuildDate><%=CurrDateT%></lastBuildDate>
<ttl>240</ttl>
<image>
<url>YOURSITEIMAGEFILE</url>
<title>YOURSITENAME</title>
<link>YOURSITEURL</link>
</image>

-------------

Now it's time to code the meat of the RSS file, which we'll cover on a separate page to keep things easy to follow. This is in the SAME FILE - it's just explained in two parts.

ASP RSS Feed Code


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2008 Minerva WebWorks LLC. All rights reserved.



Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error