ASPHTTP
lige nu kan jeg vise overskrifterne fra cnet. Men det er kun overskrifterne jeg ville gerne have lidt af under teksten med også se her.http://news.cnet.com/news/0-1005.html?tag=st.ne.1002.dir.1005
og hvordan kan man nøjes med at vise eks. 10 overskrifter ??
Scriptet er her:
<%
Sub GetTodaysNews()
Set objHttp = Server.CreateObject(\"AspHTTP.Conn\")
objHttp.Url = \"http://news.cnet.com/news/0-1005.html?tag=st.ne.1002.dir.1005\"
strPage = objHttp.GetURL
dim news(50)
I = 0
pos = 1
Do
pos = InStr(pos,strPage,\"<span class=\"\"f3\"\">\")
If pos = 0 Then Exit Do
pos = InStr(pos,strPage,\"<a\")
If pos = 0 Then Exit Do
endpos = InStr(pos+1,strPage,\"</a>\")
If endpos = 0 Then Exit Do
If endpos-pos < 110 Then \' don\'t add the long descriptions. 110 max
news(I) = \"<a target=\"\"_blank\"\" HREF=\"\"http://news.cnet.com/\" & mid(strPage,pos+10,endpos-pos-6)
I = I + 1
End If
Loop
Application(\"NewsDate\") = date
Application(\"NewsHeadlines\") = news
End Sub
\'*** you can get a fresh copy of the news whenever you want.
\'*** just modify this IF statement
If Application(\"NewsDate\") <> date() Then
Application.Lock
GetTodaysNews
Application.UnLock
End If
%>
Her er scriptet i action http://the-crawler.ath.cx/cnet.asp
