复制代码 代码如下:
import time,datetime
import urllib2
def chk_qq(qqnum):
chkurl = 'http://wpa.qq.com/pa?p=1:'+`qqnum`+':1'
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 = 12345678
stat = chk_qq(qq)
print `qq` + ' is ' + stat
import time,datetime
import urllib2
def chk_qq(qqnum):
chkurl = 'http://wpa.qq.com/pa?p=1:'+`qqnum`+':1'
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 = 12345678
stat = chk_qq(qq)
print `qq` + ' is ' + stat
标签:
python,手机QQ,在线状态
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
内蒙古资源网 Copyright www.nmgbbs.com
暂无“使用python检测手机QQ在线状态的脚本代码”评论...