ما يلي هو الرمز المصدر ، يرجى تسميته كملف .asp
نسخة الكود كما يلي:
<٪
BPN = طلب ("BPN")
إذا (bpn = "") ثم
BPN = "0"
Endif
intbpn = cint (bpn)
ifrequest ("Action") = "1" ثم
كلمة = طلب ("كلمة")
url = request ("url")
ifword <> "" ثم
GetCategories ()
ifurl <> "" ثم
getCategories2 ()
Endif
Endif
Endif
فظيعة getCategories ()
Response.write ("<b>" "& Word &" '' الكلمة الأساسية هي من بين أفضل 10 مواقع ويب في تصنيف Baidu Search! </b> <br> ")
onerrorresumenext
Dimoxmlhttp
Dimocategories
نص DimbodyTex
dimpos ، pos1
setoxmlhttp = createObject ("microsoft.xmlhttp")
oxmlhttp.open "get" ، "http://www.baidu.com/baidu؟order=" & word ، false
oxmlhttp.send
bodytext = oxmlhttp.responseBody
bodytext = bytestobstr (bodyText ، "GB2312")
pos = instr (bodytext ، "<body")
pos1 = instr (bodytext ، "</body>")
bodytext = mid (bodytext ، pos ، pos1)
bodytext = split (bodytext ، "<table")
St = 5
fori = 1to10
thei = st+i
pos = instr (bodytext (thei) ، "<td")
pos1 = instr (bodytext (thei) ، "</td>")
body = mid (bodytext (thei) ، pos ، len (bodytext (thei))-pos)
body1 = الانقسام (الجسم ، "<br>")
العنوان = body1 (0)
theurl = body1 (2)
theurl = استبدال (theurl ، "المزيد من النتائج على" ، "")
reponse.write ("T:" & title)
الرد. write ("<br>")
الرد. write ("u:" & theurl)
Response.write ("<br> <hr>")
التالي
setoxmlhttp = لا شيء
iferr.number <> 0then
كان هناك استجابة خطأ. "write
استجابة.
Endif
الوظيفية
FunctionGetCategories2 ()
onerrorresumenext
dimoxmlhttp'asobject
dimocategories'asoBject
نص DimbodyTex
dimpos ، pos1
setoxmlhttp = createObject ("microsoft.xmlhttp")