Here's the ASP code I use to display the Bible Gateway verse of the day on my local church site:
Code:
Function getXML2(feedURL)
Dim XmlDocument
Set XmlDocument = Server.CreateObject("Msxml2.DOMDocument.6.0")
XmlDocument.setProperty "ServerHTTPRequest", true
XmlDocument.async = False
Dim Loaded
Loaded = XmlDocument.load(feedURL)
If Loaded Then
Dim Items, Item, Title, Link, Description, TitleText, DescriptionText, LinkURL, Content2, Contenttext
XmlDocument.setProperty "SelectionNamespaces","xmlns:content='http://purl.org/rss/1.0/modules/content/'"
Set Items = XmlDocument.selectNodes("//item")
Response.Write "<ul>" & VbCrLf
For Each Item in Items
Set Title = Item.selectSingleNode("title/text()")
If Title Is Nothing Then
TitleText = ""
Else
TitleText = Title.data
End If
Set Link = Item.selectSingleNode("guid")
If Link Is Nothing Then
LinkURL = ""
Else
LinkURL = Trim(Link.Text)
End If
Set Content2 = Item.selectSingleNode("content:encoded/text()")
If Content2 Is Nothing Then
Contenttext = "NULL"
Else
Contenttext = Content2.Data
Contenttext = replace(ContentText,"Brought to you by <a href="http://www.edugeek.net/forums/web-development/"http://www.biblegateway.com"">BibleGateway.com</a>. Copyright (C) NIV. All Rights Reserved.","<span class=""biblegateway""><i>Brought to you by <a href="http://www.edugeek.net/forums/web-development/"http://www.biblegateway.com"">BibleGateway.com</a>. Copyright (C) NIV. All Rights Reserved.</i></span>")
End If
Set Description = Item.selectSingleNode("description/text()")
If Description Is Nothing Then
DescriptionText = ""
Else
DescriptionText = Description.data
End If
Response.Write "<li><a href="http://www.edugeek.net/forums/web-development/"" & LinkURL & """>" & TitleText & "</a></li>" & VbCrLf
response.Write Contenttext
Next
Response.Write "</ul>" & VbCrLf
End If
End Function And it's called with: Code:
getxml2("http://www.biblegateway.com/usage/votd/rss/votd.rdf") I forget where I got the original function from, and I've tweaked it a bit (with my crude replace function to italicise the "From Bible Gateway" message.)
I also have some ASP to generate an RSS feed from an access database if you're interested.
It shouldn't be too much work to combine them.