<%
'Author information:' Nickname: small gray 'QQ: 103895'Http: //asp2004.net'Http://blog.9cbs.net/iuhxq
HEHE = Hello ("http://mmsg.qq.com/cgi-bin/gddylist?type=13" "" "," html> ",". * (
Function Hello (Strull, Strstart, Strend, PATRN, REPLSTR) Str = getBody (Strurl) Str = MyMID (Str, StRSTART, STREND) STR = Replacestest (PATRN, REPLSTR, STR) Hello = Strend Function
Function mymid (str, strstart, strend) if strstart = "" THEN i = 0 else i = instr (str, str, str, str, str) ELSE J = INSTR (I, STR, STREND) End if mymid = MID (STR, I, J - I 1) End Function
Function ReplaceTest (patrn, replStr, str1) Dim regEx, match, matches Set regEx = New RegExp regEx.Pattern = patrn regEx.IgnoreCase = True regEx.Global = True Set matches = regEx.Execute (str1) For Each match in matches ReplaceTest = Replacestest & Regex.replace (Match.Value, Replstr) Nextend Function
Function GetBody (Url) Set objXML = CreateObject ( "Microsoft.XMLHTTP") With objXML .Open "Get", Url, False, "", "" .SEnd GetBody = .ResponseBody End With GetBody = BytesToBstr (GetBody, "GB2312" ) Set objxml = Nothingend function