فيما يلي رمز المصدر ، يرجى تسميته. ملف ASP.
نسخة الكود كما يلي:
<metahttp-equiv = "content-type" content = "text/html ؛ charset = gb2312">
<٪
ifrequest ("Action") = "1" ثم
كلمة = طلب ("كلمة")
url = request ("url")
ifword <> "" ثم
GetCategories ()
ifurl <> "" ثم
getCategories2 ()
Endif
Endif
Endif
فظيعة getCategories ()
Response.write ("<b>" "و Word &" '' الكلمة الأساسية هي من بين أفضل 10 مواقع ويب في تصنيف Google Search! </b> <br> ")
onerrorresumenext
Dimoxmlhttp
Dimocategories
نص DimbodyTex
dimpos ، pos1
setoxmlhttp = createObject ("microsoft.xmlhttp")
http = "http://www.google.com/search؟q=" & word & "& hl = en-cn"
oxmlhttp.open "get" ، http ، false
oxmlhttp.send
bodytext = oxmlhttp.responseBody
bodytext = bytestobstr (bodytext ، "UTF-8")
pos = instr (bodytext ، "<body")
pos1 = instr (bodytext ، "</body>")
bodytext = mid (bodytext ، pos ، pos1)
pos = instr (bodytext ، "<viv>")
bodytext = mid (bodytext ، pos)
pos1 = instr (bodytext ، "</viv>")
bodytext = mid (bodytext ، 1 ، pos1)
'Response.write (":::::" & BodyText & "::::")
bodytext = split (bodytext ، "<pclass = g>")
fori = 1to10
pos = instr (bodytext (i) ، "</a>")
thet = mid (bodytext (i) ، 1 ، pos+3)
pos = instr (bodyText (i) ، "<spandir = ltr>")
theu = mid (bodytext (i) ، pos)
pos1 = instr (theu ، "</span>")
Theu = Mid (Theu ، 1 ، pos1-1)
Response.write ("T:" & thet & "<br>")
Response.write ("u:" & theu & "<br> <hr>")
التالي
setoxmlhttp = لا شيء
iferr.number <> 0then
كان هناك استجابة خطأ. "write
استجابة.
Endif
الوظيفية
FunctionGetCategories2 ()
onerrorresumenext
dimoxmlhttp'asobject
dimocategories'asoBject
نص DimbodyTex
dimpos ، pos1
setoxmlhttp = createObject ("microsoft.xmlhttp")