<?xml version="1.0"?>
<rss version="2.0">
<%

pubDate = RSSDate(Now())

Function RSSDate(CurrDate)

	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

	RSSDate = WeekdayName(Weekday(CurrDate), TRUE) & ", " & Day(CurrDate) & " " & MonthName(Month(CurrDate), TRUE) & " " & Year(CurrDate) & " " & CurrHour & ":" & CurrMin & ":" & CurrSec & " EST"

End Function

%>
	
	<channel>
		<title>MetalBuilding.com</title>
		<link>http://www.MetalBuilding.com/</link>
		<description>Articles, news and information related to the metal and steel building industry.</description>
		<language>en-us</language>
		<pubDate><%=pubDate%></pubDate>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		<generator>MetalBuilding.com RSS 2.0</generator>
		<managingEditor>editor@metalbuilding.com</managingEditor>
		<webMaster>webmaster@metalbuilding.com</webMaster>
		<ttl>30</ttl>

<%
	count = 0

	Set Conn = Server.CreateObject ("ADODB.Connection")
	Conn.Mode = 3
	Conn.Open Application("DBConnectionString")

	SQL = "SELECT * FROM [articles] ORDER BY [thedate] DESC"
	Set RS2 = Conn.Execute (SQL)

	While not RS2.Eof and count < 20

		Dim rgx
		Set rgx = New RegExp
		rgx.Pattern = "[^a-zA-Z0-9():\.\-\ ]"
		rgx.Global = True
		rgx.IgnoreCase = True

		title = rgx.Replace(RS2("title"), "")
		shortdesc = rgx.Replace(RS2("shortdesc"), "")

		TheDate = WeekdayName(Weekday(RS2("thedate")), TRUE) & ", " & Day(RS2("thedate")) & " " & MonthName(Month(RS2("thedate")), TRUE) & " " & Year(RS2("thedate"))

		Response.Write "			<item>" & vbcrlf
		Response.Write "			  <title>" & title & "</title>" & vbcrlf
		Response.Write "			  <link>http://www.metalbuilding.com/article_lookup.html?articleid=" & RS2("id") & "</link>" & vbcrlf
		Response.Write "			  <description>" & shortdesc & "</description>" & vbcrlf
		Response.Write "			  <pubDate>" & TheDate & "</pubDate>" & vbcrlf
		Response.Write "			</item>" & vbcrlf & vbcrlf
		count = count + 1
		RS2.MoveNext

	Wend
%>

	</channel>
</rss>
