ASP Is Fun

Learning ASP
Free ASP Course
ASP Basics
ASP Functions
SQL Commands
Sample ASP Code


Servers / Setup
ASP Host Reviews
ASP Server Setup
ASP Error Tips


Contract ASP
ASP Development

Search For:


Intro to ASP


 


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

Bookmark this site so you can reference it any time you have ASP questions in the future!

Add ASP+Is+Fun+Website+ to Twitter Add ASP+Is+Fun+Website+ to Facebook Add ASP+Is+Fun+Website+ to MySpace Add ASP+Is+Fun+Website+ to Del.icio.us Digg ASP+Is+Fun+Website+ Add ASP+Is+Fun+Website+ to Yahoo My Web Add ASP+Is+Fun+Website+ to Google Bookmarks Add ASP+Is+Fun+Website+ to Stumbleupon Add ASP+Is+Fun+Website+ to Reddit



 


Get Emails when this Site is Updated



ASP Ebooks | Free ASP Course |
All content copyright 2013 Minerva WebWorks LLC. All rights reserved.

French Wedding

Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
ASP Members
ASP Shopping


Introduction to ASP

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



affiliate_link