万能小偷镜像程序的原理是什么?有什么优点和缺点?选择万能小偷建站要注意些什么?

万能小偷镜像程序的原理是什么?有什么优点和缺点?选择万能小偷建站要注意些什么?,第1张

原理:小偷程序实际上是通过了XML中的XMLHTTP组件调用其它网站上的网页。比如新闻小偷程序,很多都调用了sina的新闻网页,并且对其中的html进行了替换,同时对广告也进行了过滤。小偷程序的优点有:无须维护网站,因为小偷程序中的数据来自其他网站,它将随着该网站的更新而更新;可以节省服务器资源,一般小偷程序就几个文件,所有网页内容都是来自其他网站。缺点有:不稳定,如果目标网站出错,程序也会出错,而且,如果目标网站进行升级维护,那么小偷程序也要进行相应修改;因为是远程调用,速度和在本地服务器上读取数据比起来,肯定要慢一些。

选择万能小偷建站注意事项:一是你的网站使用了独立IP;二是:网站程序位于网站空间根目录;三是:你的网站是新建网站,内容有价值。

FileName TianQi.asp

Write By Niaoked QQ408611119

<%

if hour(now)=9 and minute(now)<30 then

getCategories()

end if

Function getCategories()

on error resume next

Dim oXMLHTTP ' As Object

Dim oCategories ' As Object

Dim BodyText

Dim Pos,Pos1

Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")

'--- set the XMLHTTP call and issue send (no parm as category

'--- is included in URL

oXMLHTTP.open "GET","http://weather.china.com.cn/travel_ ... d=56196&cityname=绵阳",False '这个地方换成你自己的地址

oXMLHTTP.send

'--- load the response into the Categories data island

BodyText=oXMLHTTP.responsebody

BodyText=BytesToBstr(BodyText,"gb2312")

Pos=Instr(BodyText," pos1=Instr(BodyText," BodyText=mid(BodyText,pos,pos1)

BodyText=split(BodyText," Pos=Instr(BodyText(4)," pos1=Instr(BodyText(4)," Body=mid(BodyText(4),pos,len(BodyText(4))-pos)

body=split(body,"body1=split(replace(replace(replace(body(0),"for i= 1 to ubound(body1)

body3=split(body1(i),"weather=weather &"document.write("""&i&"$" &"天气" &HTMLEncode(trim(body3(0))) &""")" &vbcrlf

next

weather=replace(weather,"1$","weather=replace(weather,"2$","weather=replace(weather,"3$"," Set fs = CreateObject("Scripting.FileSystemObject")

Set f = fs.CreateTextFile(request.ServerVariables("APPL_PHYSICAL_PATH")&"tq.js", True)

f.write("document.write('绵阳天气预报:')" &vbcrlf & replace(weather," f.close

Set f = nothing

Set fs = nothing

response.write "绵阳天气预报:"&weather

Set oXMLHTTP = Nothing

if err.number<>0 then

response.write "出错了,错误描述:"&err.description &"response.End()

end if

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

Public Function HTMLEncode(fString)

If Not IsNull(fString) Then

fString = replace(fString, ">", ">")

fString = replace(fString, "<", "<")

fString = Replace(fString, CHR(32), " ") '

fString = Replace(fString, CHR(9), " ") '

fString = Replace(fString, CHR(34), """)

fString = Replace(fString, CHR(39), "'") '单引号过滤

fString = Replace(fString, CHR(13), "")

fString = Replace(fString, CHR(10) &CHR(10), " fString = Replace(fString, CHR(10), " HTMLEncode = fString

End If

End Function

%>

如果要嵌入别人的网页信息,直接加一个iframe就可以实现。

如果要分过滤别人站点的信息,可以在后天用java配合ajax来实现,用java中的URL类先连接别人的站点,然后读取信息进行过滤,然后返回到页面中显示。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/11018077.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-13
下一篇 2023-05-13

发表评论

登录后才能评论

评论列表(0条)

保存