J
John Smith
Hi,
I'm trying to read a moreover news feed and then store that information in a
database. The problem that I am having is with reading the feed from the
script. Is this the correct way to read a feed over http rather than an XML
file ? Is there an easier way to handle dumping XML info directly into a
database ?
Thanks,
J
Script :
Dim strtitle,strlink,strdescription,strguid,strpubDate,strsource
Dim xml,xmlURL
xmlURL="http://p.moreover.com/cgi-local/page?o=rss002&c=UK immigration news"
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xml.async = False
xml.load (xmlURL)
Dim NodeList
Set NodeList = xml.documentElement.selectNodes("item")
Dim Node
For Each Node In NodeList
strtitle = Node.selectSingleNode("title").Text
strlink = Node.selectSingleNode("link").Text
strdescription = Node.selectSingleNode("description").Text
strguid = Node.selectSingleNode("guid").Text
strpubDate = Node.selectSingleNode("pubDate").Text
strsource = Node.selectSingleNode("source").Text
Next
'See if anything was read properly
Response.Write(strtitle)
XML layout from feed :
<rss version="2.0">
<channel>
<title>
Moreover Technologies
</title>
<link>http://www.moreover.com/rss</link>
<description>
Moreover Technologies
</description>
<language>en-us</language>
<image>
<title>Moreover Technologies</title>
<url>http://i.moreover.com/pics/rss.gif</url>
<link>http://www.moreover.com/rss</link>
<width>144</width>
<height>16</height>
<description>
Moreover Technologies
</description>
</image>
<item>
<title>Sponsored Link</title>
<link>
http://www.lalala.com
</link>
<description>
Ad - Over 85 locations and online programs available. Request free info.
</description>
<guid isPermaLink="false">ad20070323120000</guid>
<pubDate>Fri, 23 Mar 2007 14:31:00 GMT</pubDate>
</item>
</channel>
</rss>
I'm trying to read a moreover news feed and then store that information in a
database. The problem that I am having is with reading the feed from the
script. Is this the correct way to read a feed over http rather than an XML
file ? Is there an easier way to handle dumping XML info directly into a
database ?
Thanks,
J
Script :
Dim strtitle,strlink,strdescription,strguid,strpubDate,strsource
Dim xml,xmlURL
xmlURL="http://p.moreover.com/cgi-local/page?o=rss002&c=UK immigration news"
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.setProperty "ServerHTTPRequest", true
xml.async = False
xml.load (xmlURL)
Dim NodeList
Set NodeList = xml.documentElement.selectNodes("item")
Dim Node
For Each Node In NodeList
strtitle = Node.selectSingleNode("title").Text
strlink = Node.selectSingleNode("link").Text
strdescription = Node.selectSingleNode("description").Text
strguid = Node.selectSingleNode("guid").Text
strpubDate = Node.selectSingleNode("pubDate").Text
strsource = Node.selectSingleNode("source").Text
Next
'See if anything was read properly
Response.Write(strtitle)
XML layout from feed :
<rss version="2.0">
<channel>
<title>
Moreover Technologies
</title>
<link>http://www.moreover.com/rss</link>
<description>
Moreover Technologies
</description>
<language>en-us</language>
<image>
<title>Moreover Technologies</title>
<url>http://i.moreover.com/pics/rss.gif</url>
<link>http://www.moreover.com/rss</link>
<width>144</width>
<height>16</height>
<description>
Moreover Technologies
</description>
</image>
<item>
<title>Sponsored Link</title>
<link>
http://www.lalala.com
</link>
<description>
Ad - Over 85 locations and online programs available. Request free info.
</description>
<guid isPermaLink="false">ad20070323120000</guid>
<pubDate>Fri, 23 Mar 2007 14:31:00 GMT</pubDate>
</item>
</channel>
</rss>