%
On Error Resume Next
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
'参数设置
dim wd,tn,from,cl,rn,ct
tn=request.QueryString("tn")
from=request.QueryString("from")
cl=request.QueryString("cl")
rn=request.QueryString("rn")
ct=request.QueryString("ct")
word=request.QueryString("word")
ie=request.QueryString("ie")
bt=request.QueryString("bt")
et=request.QueryString("et")
si=request.QueryString("si")
tn=request.QueryString("tn")
pn=request.QueryString("pn")
clk=request.QueryString("clk")
bs=request.QueryString("bs")
sr=request.QueryString("sr")
'判断
If word<>"" Then
If pn=0 Then
url="http://news.baidu.com/ns?cl="&cl&"&rn="&rn&"&tn="&tn&"&word="&word&"&clk="&clk&""
Else
url="http://news.baidu.com/ns?bt="&bt&"&et="&et&"&si="&si&"&rn="&rn&"&tn="&th&"&ie="&ie&"&ct="&ct&"&word="&word&"&pn="&pn&"&cl="&cl&"&clk="&clk&"&bs="&bs&"&sr="&sr&""
End If
Else
url="http://news.baidu.com/"
End IF
'输出
html=getHTTPPage(url)
'替换
html=replace(html,"action=/ns","action=poss.asp")
html=replace(html,"name=word","name=Key")
html=replace(html,"百度新闻搜索","必度新闻搜索")
html=replace(html,"百度不刊登","必度不刊登")
html=replace(html,"使用百度前必读"," ")
html=replace(html,"百度建","必度建")
html=replace(html,"在百度","在必度")
html=replace(html,"把百度","把必度")
html=replace(html,"百度一下","必度一下")
html=replace(html,"http://www.baidu.com/duty/","")
html=replace(html,"http://www.netsoz.com/","http://www.netsoz.com/")
html=replace(html,"action=/ns name=f1","action=poss.asp name=Key")
html=replace(html,"/view.html","../")
html=replace(html,"src=image/","src=http://news.baidu.com/image/")
html=replace(html,""," ")
html=replace(html,"/n?cmd=1&class=","l.asp?Key=")
html=replace(html," 个性化新闻 |"," ")
html=replace(html,"| 更多资讯服务>>","| 更多资讯服务>>")
html=replace(html,"/ni?u="," ")
html=replace(html,"src=""news/img/logo-news.gif"" width=137 height=46","src=""imges/logo-news.gif""")
html=replace(html,"/n?cmd=2&page=","u.asp?Key=")
html=replace(html,"href=""http://www.baidu.com/"">网页","href=""../"">网页")
html=replace(html,"href=""../tieba/"">贴吧","href=""../tieba/"">贴吧")
html=replace(html,"href=""../zhidao/"">知道","href=""../zhidao/"">知道")
html=replace(html,"href=""http://shiwww.com/"">门户","href=""http://shiwww.com/"">门户")
html=replace(html,"href=""http://image.baidu.com/"">图片","href=""../image/"">图片")
html=replace(html,"href=""http://video.baidu.com/"">视频","href=""../115/v/?q=热门视频/"">视频")
html=replace(html,"href=""http://www.baidu.com/more/index.html"">更多","href=""../Top/"">搜索风云榜")
html=replace(html,"帮助 | 高级搜索 | 必度推广"," ")
html=replace(html,"必度搜索","搜索")
html=replace(html,"Baidu 使用必度新闻搜索前必读","必度科技")
html=replace(html,"/n?cmd=5&page=","f.asp?Key=")
html=replace(html,"/n?cmd=8&page=","e.asp?Key=")
html=replace(html,"this,'http://www.baidu.com'","this,'../news'")
html=replace(html,"/n?cmd=9&class=","pic.asp?Key=")
html=replace(html,"src=""images/","src=""http://news.baidu.com/image/")
html=replace(html,"onsubmit=""return g(this)"" name=""f1"""," ")
html=replace(html,"http://www.baidu.com/search/news_more.html","..top")
html=replace(html,"| 个性化新闻 "," ")
html=replace(html,"/n?cmd=4&class=","h.asp?Key=")
html=replace(html,"文明办网举报电话:010-82621188-6322 举报邮箱:www@pekdo.com"," ")
html=replace(html,"","")
html=replace(html,"","")
html=replace(html,"http://www.baidu.com/baidu?tn=baidu&cl=3&word=","http://www.netsoz.com/go.asp?Key=")
html=replace(html,"src=""../news/img/logo-news.gif"" width=137 height=46","src=""../news/img/news-jg.gif""")
html=replace(html,"http://www.baidu.com/s?cl=3&wd=","../s/?wd=")
html=replace(html,"帮助 | 高级搜索 | 偏好设置"," ")
html=replace(html,"©2006 Baidu
图片",">图片")
html=replace(html,"与必度科技对话"," ")
html=replace(html,"http://utility.baidu.com/quality/quality_form.php?word="," ")
html=replace(html,"/ns?word=","poss.asp?Key=")
html=replace(html,"/ns","More.asp")
html=replace(html,"