<?xml version='1.0'?>
<rss version='2.0'>
<channel>
<title>Prairie Astronomy Club News</title>
<link>http://www.prairieastronomyclub.org/</link>
<description>News and Announcements from the Prairie Astronomy Club, Lincoln, Nebraska.</description>
<language>en-us</language>


<%
	set Conn = Server.CreateObject("ADODB.Connection")
	
	Conn.Open Application("DSN") 
	sql = "select * from objects where type_announcement = -1 and isactive = -1  and display_location <> 1 "
	sql = sql & " and (( expiredate > '" & formatdatetime(date-90) & "' ) "
'	sql = sql &  " or expiredate is null "
	sql = sql & " ) "
	sql = sql & " order by objectdate desc"
'response.write sql
	Set rs = conn.Execute(sql)
	on error resume next
	if rs.eof or rs.bof then   dbrecords = false else dbrecords = true

	articlecount = 0
	article =  ""
	if dbrecords then

	do while not rs.eof
		if len(rs("synopsis") ) > 0  then

		title = rs("title")		
		response.write "<item>" & vbcrlf
		response.write "<title>" & title & "</title>" & vbcrlf
		
		if len(rs("url")) > 0 then 
			response.write "<link>" & rs("url") & "</link>" & vbcrlf
		end if

'		if len(rs("object_filename")) > 0 then 
'			article = article & " <a href=""/public/" & rs("object_filename") & """>" & title & "</a> "
'		end if

		if len(rs("synopsis") ) > 0 then response.write "<description>" & fixstring(rs("synopsis")) & "</description>" & vbcrlf
		dt = weekdayname(weekday(rs("objectdate")),true) & ", " & day(rs("objectdate")) & " " & monthname(month(rs("objectdate")),true) & " " &  year(rs("objectdate")) & " 00:00 CST"

		response.write "<pubDate>" & dt & "</pubDate>" & vbcrlf
		response.write "</item>" & vbcrlf

		articlecount = articlecount + 1
		if articlecount > 20 then exit do

		end if ' if synopsis
		rs.movenext
		if rs.eof then dbrecords = false: exit do
	loop

	response.write article 

	end if
	rs.close
	set rs = nothing

	conn.Close
	Set conn = Nothing 
%>

</channel>
</rss>

<% function fixstring(strText)

	fixstring = replace(replace(strText,"<","&lt;"),">","&gt;")
	
end function
%>