QQ在线状态代码
技术  /  管理员 发布于 8年前   660
但是腾讯的这个页面改过版了,我是今天才发现的。用以前的代码已经不能点击打开聊天窗口了,生成的新代码比以前长了,多了个sigkey,64位的(好长 )。
以我的QQ为例子,在那个页面生成的代码如下:
复制代码 代码如下:
<a href="http://sighttp.qq.com/cgi-bin/check?sigkey=cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:56536321:2' alt="56536321"></a>
是不是很长?而且就这样放进网页,那么页面肯定过不了W3C认证,SRC是大写,再如“;target=_blank; ”。如果要放好几个QQ,那页面岂不是也很乱。怎么办?
我对比了两个QQ,发现只有那个64位的sigkey不一样,所以可以把onclick移出来,代码:
复制代码 代码如下:
<script type="text/javascript">
function QQtalk(sigkey) {
var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey='+sigkey;
var oldscript=document.getElementById('testJs');
var newscript=document.createElement('script');
newscript.setAttribute('type','text/javascript');
newscript.setAttribute('id', 'testJs');
newscript.setAttribute('src',tempSrc);
if(oldscript == null) {
document.body.appendChild(newscript);
}
else {
oldscript.parentNode.replaceChild(newscript, oldscript);
}
return false;
}
</script>
然后直接onclick="return QQtalk('cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2');"
网页body内的代码可以写成: <a href="http://sighttp.qq.com/cgi-bin/check?sigkey=cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2" target="_blank" onclick="return QQtalk('cfad9f0a103b59616e94d667dd5755e92c2be98ded5ad949a940399e013adfe2');"><img src="http://wpa.qq.com/pa?p=1:56536321:3" alt="56536321"></a>
test1 在
opencode + Oh-my-openagent,我的第一个免费的ai编程智能体管家:Sisyphus中评论 test..122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..Zita 在
Google AI Studio升级全栈 vibe coding体验,可直接构建带登录和数据库的应用中评论 111222..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号
