<%
Sub atom(URL)
Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", True
objXML.validateOnParse = true
objXML.preserveWhiteSpace = false
dim uniques(75)
itemno = 0
If Not objXML.Load(URL) Then
Response.write "
"
Else
Set objNodeList = objXML.getElementsByTagName("entry")
For Each objNode In objNodeList
itemno = itemno + 1
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "source"
For Each objNode3 In objNode2.childNodes
Select Case objNode3.nodeName
Case "title"
StrSource = objNode3.text
end select
next
Case "issued"
strdate= left(objNode2.firstChild.nodevalue,10)
Case "link"
strURL = objNode2.GetAttribute("href")
Case "title"
strTitle = objNode2.firstChild.nodevalue
End Select
Next
uniqueitem = 1
if itemno > 1 then
for i = 1 to itemno - 1
if uniques(i) = strSource then
uniqueitem = 0
end if
next
end if
if uniqueitem = 1 then
hasBreak = inStr(strTitle," ")
if hasBreak > 0 then
strTitle = left(strTitle,hasbreak-1)
end if
strTitle = replace(strTitle ,chr(146),"'")
strTitle = replace(strTitle ,chr(145),"'")
strTitle = replace(strTitle ,chr(147),"""")
strTitle = replace(strTitle ,chr(148),"""")
Response.write "
"
uniques(itemno)=strSource
end if
strTitle = ""
strURL = ""
strDescription = ""
strSource = ""
Next
set objNodeList = Nothing
End if
End sub
call atom("http://www.google.com/reader/public/atom/user/16312145566598809567/label/blogroll?n=75")
%>
Well scary, but well worth it :-)
Post a CommentPermalink Subscribe to comments: this post | all posts
<< T*Blog Home