标签:
一段查询QQ是否在线的代码
通过访问http://wpa.qq.com/pa?p=1:[QQ号码]:1查询返回的图片
如果返回 2329 则在线 2262 则离线
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import time,datetime import urllib2 def chk_qq(qqnum): a = urllib2.urlopen(chkurl) length = a.headers.get( "content-length" ) a.close() print datetime.datetime.now() if length = = ‘2329‘ : return ‘Online‘ elif length = = ‘2262‘ : return ‘Offline‘ else : return ‘Unknown Status!‘ qq = 77199084 stat = chk_qq(qq) print `qq` + ‘ is ‘ + stat |
标签:
原文地址:http://www.cnblogs.com/shouce/p/5476464.html