เพื่อนหลายคนไม่เข้าใจโปรแกรมขโมยหรือไม่? คุณรู้หรือไม่ว่าโปรแกรมขโมยคืออะไร? วันนี้ลองมาดูกันว่า ASP Alexa สามารถใช้โปรแกรมการสอบถามกับบรรณาธิการของ Foxin ได้อย่างไร ในความเป็นจริงปัญหานี้ไม่ยากอย่างที่เราจินตนาการไว้
-
'เพื่อสนับสนุนความคิดริเริ่มโปรดเก็บความคิดเห็นไว้ที่นี่ขอบคุณ!
'ผู้แต่ง: Cao Shangfei
'รับชื่อโดเมนหลัก
ฟังก์ชั่น getDomainurl (URL)
tempurl = แทนที่ (url, "http: //", "")
ถ้า instr (tempurl, "/")> 0 แล้ว
Tempurl = ซ้าย (Tempurl, Instr (Tempurl, "/")-1)
สิ้นสุดถ้า
getDomainurl = tempurl
ฟังก์ชันสิ้นสุด
ฟังก์ชั่น gethttppage (httpurl)
ถ้า isnull (httpurl) = true หรือ len (httpurl) <18 หรือ httpurl = "$ false $"
gethttppage = "$ false $"
ฟังก์ชั่นออก
สิ้นสุดถ้า
สลัว http
ตั้งค่า http = server.createObject ("msxml2.xmlhttp"))
http.open "get", httpurl, false
http.send ()
ถ้า http.readystate <> 4 แล้ว
ตั้งค่า http = ไม่มีอะไร
gethttppage = "$ false $"
ฟังก์ชั่นออก
สิ้นสุดถ้า
gethttppage = http.responsetext
ตั้งค่า http = ไม่มีอะไร
ถ้า err.number <> 0 แล้ว
err.lear
สิ้นสุดถ้า
ฟังก์ชันสิ้นสุด
-
'ชื่อฟังก์ชั่น: Scripthtml
'ฟังก์ชั่น: แท็กตัวกรอง HTML
'ข้อโต้แย้ง: ข้อ จำกัด ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'tagname ------- แท็กที่จะกรอง
'ftype 1 หมายถึงการกรองป้ายกำกับซ้าย 2 หมายถึงการกรองป้ายกำกับด้านซ้ายและค่ากลาง 3 หมายถึงการกรองฉลากด้านซ้ายและฉลากด้านขวาเพื่อรักษาเนื้อหา
-
ฟังก์ชั่น SCRIPTHTML (BYVAL CRANC
Dim re
ตั้งค่า re = ใหม่ regexp
re.ignorecase = true
re.global = true
เลือกกรณี ftype
กรณีที่ 1
re.pattern = "<" & tagname & "([^>])*(" & includest & ") {1,} ([^>])*>"
cronst = re.replace (const, "")
กรณีที่ 2
re.pattern = "<" & tagname & "([^>])*(" & includest & ") {1,} ([^>])*>.*? </" & tagname & "([^>])*>"
'response.write cronst & "<br>"
cronst = re.replace (const, "")
'response.write server.htmlencode (cronst) & "<br>"
กรณีที่ 3
re.pattern = "<" & tagname & "([^>])*(" & includest & ") {1,} ([^>])*>"
cronst = re.replace (const, "")
re.pattern = "</" & tagname & "([^>])*>"
cronst = re.replace (const, "")
สิ้นสุดเลือก
scripthtml = cronst
ตั้งค่า re = ไม่มีอะไร
ฟังก์ชันสิ้นสุด
-
'ชื่อฟังก์ชั่น: getbody
'เอฟเฟกต์: สกัดกั้นสตริง
'อาร์กิวเมนต์: ข้อ จำกัด ------- สตริงที่จะสกัดกั้น
'อาร์กิวเมนต์: startstr ------ เริ่มสตริง
'อาร์กิวเมนต์: Overstr ------- end String
'บทความ: Inclul ------- ไม่ว่าจะรวม startstr
'บทความ: Inclur --------- รวม Overstr
-
ฟังก์ชั่น getbody (ข้อ จำกัด , startstr, overstr, inclul, inclur)
ถ้า constr = "$ false $" หรือ const = "" หรือ isnull (constr) = true หรือ startstr = "" isnull (startstr) = true orgater หรือ overstr = "" isnull (overstr) = true แล้ว
getBody = "$ false $"
ฟังก์ชั่นออก
สิ้นสุดถ้า
dim constrtemp
สลัวเริ่มมากกว่า
constrtemp = lcase (ข้อ จำกัด )
startstr = lcase (startstr)
overstr = lcase (overstr)
start = instrb (1, Stractemp, StartStr, VbBinaryCompare)
'response.write start & "<br>" & inclul & "<br>"
'response.end
ถ้าเริ่ม <= 0 จากนั้น
getBody = "$ false $"
ฟังก์ชั่นออก
อื่น
ถ้า inclul = false แล้ว
start = start+lenb (startstr)
สิ้นสุดถ้า
สิ้นสุดถ้า
over = instrb (เริ่มต้น, constrtemp, overstr, vbbinaryCompare)
'response.write มากกว่า
'response.end
'response.write start & "& over &" "& over-start
'response.end
ถ้าเกิน <= 0 หรือมากกว่า <= เริ่มจากนั้น
getBody = "$ false $"
ฟังก์ชั่นออก
อื่น
ถ้า inclur = true แล้ว
over = over+lenb (overstr)
สิ้นสุดถ้า
สิ้นสุดถ้า
getBody = MIDB (ข้อ จำกัด เริ่มต้นเริ่มต้น)
'response.write getbody
'response.end
ฟังก์ชันสิ้นสุด
-
'ชื่อฟังก์ชั่น: getArray
'วิธีการ: แยกที่อยู่ลิงค์คั่นด้วย $ array $
'อาร์กิวเมนต์: ข้อ จำกัด ------- แยกอักขระดั้งเดิมของที่อยู่
'อาร์กิวเมนต์: startstr ------ เริ่มสตริง
'อาร์กิวเมนต์: Overstr ------- end String
'บทความ: Inclul ------- ไม่ว่าจะรวม startstr
'บทความ: Inclur --------- รวม Overstr
-
ฟังก์ชั่น getArray (byval const, startstr, overstr, inclul, inclur)
ถ้า constr = "$ false $" หรือ const = "" หรือ isnull (constr) = true หรือ startstr = "" overstr = "" หรือ isnull (startstr) = true or isnull (overstr) = true แล้ว
getArray = "$ false $"
ฟังก์ชั่นออก
สิ้นสุดถ้า
Dim TempStr, Tempstr2, Objregexp, Matches, Match
tempstr = ""
ตั้งค่า objregexp = ใหม่ regexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "(" & startstr & ").+? (" & overstr & ")"
ตั้งค่าการจับคู่ = objregexp.execute (const)
สำหรับการแข่งขันแต่ละนัดในการแข่งขัน
tempstr = tempstr & "$ array $" & match.value
ต่อไป
ตั้งค่าการจับคู่ = ไม่มีอะไร
ถ้า tempstr = "" แล้ว
getArray = "$ false $"
ฟังก์ชั่นออก
สิ้นสุดถ้า
tempstr = ขวา (Tempstr, len (tempstr) -7)
ถ้า inclul = false แล้ว
objregexp.pattern = startstr
tempstr = objregexp.replace (tempstr, "")
สิ้นสุดถ้า
ถ้า inclur = false แล้ว
objregexp.pattern = overstr
tempstr = objregexp.replace (tempstr, "")
สิ้นสุดถ้า
ตั้งค่า objregexp = ไม่มีอะไร
ตั้งค่าการจับคู่ = ไม่มีอะไร
ถ้า tempstr = "" แล้ว
getArray = "$ false $"
อื่น
getArray = tempstr
สิ้นสุดถ้า
ฟังก์ชันสิ้นสุด
ฟังก์ชั่น getalexarank (webuurl)
Tempurl = getDomainurl (wewebrl)
'อ่านข้อมูลใน http://client.alexa.com/common/css/scramble.css
Alexacss = "http://client.alexa.com/common/css/scramble.css"
stralexacss = gethttppage (Alexacss)
'response.write stralexacss
'response.end
AlexarankQueryUrl = "http://www.alexa.com/data/details/traffic_details/" & tempurl
stralexacontent = gethttppage (AlexarankQueryurl)
RankContent = getBody (stralexacontent, "บริการข้อมูล.->", "<!-google_ad_section_end (ชื่อ = ค่าเริ่มต้น)->", เท็จ, เท็จ)
'รับคลาสของช่วงในนั้น
strSpan = getArray (RankContent, "<span class =" "", "" ", false, false)
'Response.write RankContent & "<br>"
'Response.write strspan & "<br>"
'response.end
ถ้า strspan <> "$ false $" แล้ว
ASPAN = Split (StrSpan, "$ array $")
สำหรับ i = 0 ถึง ubound (aspan)
'Response.write "." & Aspan (i)
'ตรวจสอบว่า Aspan (i) เช่นคลาสของสปักมีอยู่ใน Alexacss หรือไม่ หากมีอยู่ข้อมูลในช่วงและช่วงจะต้องถูกลบออก
ถ้า instr (stralexacss, "." & aspan (i))> = 1 แล้ว
'response.write aspan (i) & "<br>"
'response.end
'หมายความว่าทรัพย์สินนั้นไม่มี มันจะต้องถูกแทนที่
RankContent = SCRIPHTML (RankContent, "Span", 2, Aspan (i))
อื่น
RankContent = Scripthtml (RankContent, "Span", 1, Aspan (i))
สิ้นสุดถ้า
ต่อไป
'แทนที่แท็ก span ทางด้านขวาที่ถูกลบออกน้อยกว่าด้านบน
RankContent = แทนที่ (RankContent, "</span>", "")
สิ้นสุดถ้า
ถ้า RankContent = "$ false $" แล้ว
RankContent = "ไม่มีข้อมูล"
สิ้นสุดถ้า
getAlexarank = แทนที่ (RankContent, ",", ",", ")
ฟังก์ชันสิ้นสุด
url = request.querystring ("url")
-
<form name = "Alexaform" method = get>
ป้อน URL: <input type = "" name = "url" value = "<%= url%>" size = 40> <input type = "submit" value = "Query">>
</form>
-
ถ้า url <> "" แล้ว
Response.write "เว็บไซต์ของคุณจัดอันดับที่ Alexa เป็น:"
Response.flush
Rank = Getalexarank (URL)
Response.write อันดับ
สิ้นสุดถ้า
-
ข้างต้นเป็นเรื่องเกี่ยวกับวิธีการที่ ASP Alexa สามารถสอบถามโปรแกรมขโมยได้ บทความนี้แนะนำโปรแกรม Alexa Thief ที่ค่อนข้างง่าย เพื่อนที่ชอบฟังก์ชั่นนี้สามารถเรียนรู้หลักการของมันได้ ฉันเชื่อว่าคุณสามารถเขียนโปรแกรมนี้ได้เร็ว ๆ นี้