There are many popular thief programs on the Internet now, including news thieves, music thieves, and download thieves. So how do they do it? I will give a brief introduction below, hoping that it will be helpful to all webmasters.
(I) Principle
The thief program actually calls web pages on other websites through the XMLHTTP component in XML. For example, in the news thief program, many of them call Sina's news pages, and some replacements are made to the html in it, and the advertisements are also filtered. The advantages of using a thief program are: there is no need to maintain the website, because the data in the thief program comes from other websites, and it will be updated as the website is updated; it can save server resources. Generally, the thief program only has a few files, and all web page content is From other websites. Disadvantages are: unstable, if the target website errors, the program will also be errored, and if the target website is upgraded and maintained, the thief program must also be modified accordingly; speed, because it is a remote call, speed and reading data on the local server. Compared to this, it must be slower.
(II) Example
Here is a brief explanation of the application of XMLHTTP in ASP
| <% 'Common functions '1. Enter the URL destination web page address, and the return value getHTTPPage is the html code of the destination web page 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 '2. Convert Lanma, directly call a web page with Chinese characters with xmlhttp, you will get Lanma, which can be converted through the adodb.stream component. 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 'The following is to try calling the html content of http://www.3doing.com/earticle/ Dim Url,Html Url=http://www.3doing.com/earticle/ Html = getHTTPPage(Url) Response.write Html %> |