%
'
' using Atom.asp in a news generator from blogger feed optimized for google news
' Author: Francesco Passantino
' Email: francesco@iteam5.net
' Blog: www.iteam5.net/blog
' Start date: 3 Feb 2004
' Last modified date: 3 gen 2005
Sub atom(news,titoli)
nomemese=array("gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic")
url="http://www.iteam5.net/blog/feed.xml"
Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
objXML.async = false
objXML.setProperty "ServerHTTPRequest", True
objXML.validateOnParse = true
objXML.preserveWhiteSpace = false
If Not objXML.Load(URL) Then
Response.write "
ERROR
code: " & _
objXML.parseError.errorCode & _
"
Linea/Col: " & _
objXML.parseError.line & "/" & _
objXML.parseError.linepos & "
"
Else
Set objNodeList = objXML.getElementsByTagName("entry")
For Each objNode In objNodeList
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "id"
strid= objNode2.firstChild.nodevalue
Case "issued"
strdate= left(objNode2.firstChild.nodevalue,10)
if strdate<>"" then
strdate=right(strdate,2)*1&" "&nomemese(mid(strdate,6,2)-1)&" "&left(strdate,4)
end if
Case "link"
strURL = objNode2.GetAttribute("href")
Case "title"
strTitle = objNode2.firstChild.nodevalue
'istead of Case "content"
Case "summary"
strDescription = objNode2.firstChild.data
For Each objNode3 In objNode2.childNodes
Select Case objNode3.nodeName
Case "div"
StrDescription = objNode3.text
For Each objNode4 In objNode3.childNodes
Select Case objNode4.nodeName
Case "a"
linkable=objNode4.firstChild.text
htmlink=" "& _
linkable&""
StrDescription = replace(StrDescription,linkable,htmlink)
end select
next
end select
next
End Select
Next
if news="" then news=strid
strtitle=replace(strtitle,"
"," ")
if (titoli=false and news=strid) then
Response.write (""& strTitle&" - iteam5.net/blog news")
Response.write ""&strtitle&"
iteam5.net - "& strdate & "
" & strDescription&""
end if
if titoli=true and news<>strid then
Response.write "["&strdate&"] " & _
strTitle & "
"
end if
strTitle = ""
strURL = ""
strDescription = ""
strid=""
Next
set objNodeList = Nothing
End if
End sub
newsf=request("newsid")
response.write ("
")
call atom(newsf,false)
response.write(" Ultime notizie: ")
call atom(newsf,true)
nomemeselungo=array("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre")
response.write(" Archivio:
")
'this trick because my news start in august 2003
for anno=2003 to year(now)
for mese =1 to 12
if anno=2003 then
if mese>7 then
meset=mese
if mese<10 then meset="0"&mese
response.write (""&nomemeselungo(meset-1)&" "&anno&" ")
end if
end if
if anno>2003 then
if mese<=month(now) or anno"&nomemeselungo(meset-1)&" "&anno&" ")
end if
end if
next
next
%>
News Feed
|