QQ.ASP <PRE id=code><FONT id=code face="Verdana, Arial" size=1>
<%@Language=VBScript%>
<%
http://aboutcn.com ;
Dim qq, style, set_on, set_off, mode, limituse, limitnumber, imgurl, self_online, self_offline
Dim line, data, out, temp1, temp2, temp3, online, offline
Dim img, text
qq = Request.QueryString("qq")
style = Request.QueryString("style")
set_on = Request.QueryString("on")
set_off = Request.QueryString("off")
mode = Request.QueryString("mode")
If set_on <> "" Or set_off <> "" Then style = "set"
Set Fs = Server.CreateObject("Scripting.FileSystemObject")
filepath = Server.MapPath("config.asp")
Set File = Fs.OpenTextFile(filepath, 1, False)
Do
line = File.ReadLine
line = Replace(line, Chr(10), "")
line = Replace(line, Chr(13), "")
line = Replace(line, ";", "")
line = Replace(line, ",", "")
line = Replace(line, " ", "")
line = Replace(line, Chr(34), "")
line = Replace(line, " ", "")
data = Split(line, "=")
Select Case data(0)
Case "limituse":
limituse = data(1)
Case "limitnumber":
limitnumber = Split(data(1), ",")
Case "imgurl":
imgurl = data(1)
Case "self_online":
self_online = data(1)
Case "self_offline":
self_offline = data(1)
Case Else:
End Select
Loop Until File.AtEndOfStream
File.close
Set Fs = Nothing
Set File = Nothing
img = imgurl & "/unreg.gif"
text = "不在线上。"
If AllowUse() Then
out = GetHtml()
If out <> "" Then
temp1 = Split(out, "ShowResult")
temp2 = Split(temp1(2), "</script>")
temp3 = Split(temp2(0), Chr(34) & "," & Chr(34))
out = temp3(1)
If out <> "" Then
Select Case style
Case "1", "2", "3", "4", "5", "6", "7", "8", "9", "10":
online = imgurl & "/online" & style & ".gif"
offline = imgurl & "/offline" & style & ".gif"
Case "l", "L":
online = out
online = Replace(online, "/l/", "/s/")
online = Replace(online, "-0", "-2")
online = Replace(online, "-1", "-3")
offline = online
Case "s", "S":
online = out
offline = online
Case "set", "SET":
If set_on = "" Then
set_on = self_online
End If
If set_off = "" Then
set_off = self_offline
End If
online = set_on
offline = set_off
Case Else:
online = imgurl & "/online0.gif"
offline = imgurl & "/offline0.gif"
End Select
If Instr(out, "-2") <> 0 Then
img = online
text = "正在线上!"
Else
img = offline
End If
End If
End If
End If
If mode = "script" Then
Response.Write
"document.write(<a target=_blank
href=" & Chr(34) & "http://search.tencent.com/cgi-bin/friend/user_show_info?ln=" & qq & Chr(34) & "
title=" & Chr(34) & "我的QQ号码是 " & qq & " ,目前" & text & Chr(34) & "><img src=" & Chr(34) & img & Chr(34) & " border=0></a>);"
Else
Response.Redirect img
End If
Function GetHtml
Set Receive = CreateObject("Microsoft.XMLHTTP")
With Receive
.Open "GET", "http://search.tencent.com/cgi-bin/friend/oicq_find?oicq_no=" & qq, False, "", ""
.Send
GetHtml = .ResponseText
End With
Set Receive = Nothing
End Function
Function AllowUse
Dim i
If limituse = 0 Then
AllowUse = True
Else
AllowUse = False
For i = 0 To UBound(limitnumber)
If qq = CStr(limitnumber(i)) Then
AllowUse = True
End If
Next
End If
End Function
%>
</FONT></PRE>CONfig.asp <PRE id=code><FONT id=code face="Verdana, Arial" size=1>limituse = 0
limitnumber = 107625796,57817108
imgurl = http://www.mydomain.com/addon/qq/img
self_online = http://www.mydomain.com/addon/qq/img/0-0.gif
self_offline = http://www.mydomain.com/addon/qq/img/0-1.gif
</FONT></PRE>使用方法:
<SCRIPT src="http://www.aboutcn.com/addon/qq/qq.asp?qq=107625796&style=1&mode=script"></SCRIPT>