自动回复
来源:互联网 发布:html5翻牌小游戏源码 编辑:程序博客网 时间:2024/06/02 18:44
注: 这里说的自动回复是依赖第三方 API的
我这里用的API是 www.xiaohuangji.com
它的API(API我自己用chrome console 看的)有两种 POST 和 GET
POST
type : posturl: http://www.xiaohuangji.com/ajax.php参数: para
GET
Type : gethttp://www.xiaohuangji.com/ajax.php?para=1234
如果自己在写一些测试的时候发现 cross origin 类似的错误,可以把浏览器的跨域安全给关掉或者直接用一些专门发request 的工具(在线的也可以). 在Mac 下关掉 chrome 跨域安全是 open -a /Applications/Google\ Chrome.app --args --disable-web-security
(其它的一些自己搜索 关掉chrome 跨哉)
我自己用这个API做了一个web QQ自动回复的,比较简陋,是用javascript 写的. 使用很简单,登陆好 WebQQ,把窗口拖小一点, 然后打一个好友聊天的对话框,QQ群也可以,但是计论组不可以. 然后打开 Chrome 控制台,运行所有的 javascript 代码就好.
xmlHttpReg = new XMLHttpRequest();lastM = ''; //获取最后一条消息function getLastMessage(){ chatContent = document.getElementsByClassName('buddy'); last = chatContent[chatContent.length-1]; lastAllChildren = last.children; lastMsg = lastAllChildren[lastAllChildren.length - 1]; lastMsgContent = lastMsg.innerText; //lastM = lastMsgContent; console.log("getLastMessage success!! " + lastMsgContent); return lastMsgContent;} //发送消息function sendContent(content) { document.getElementById('chat_textarea').value=content; document.getElementById('send_chat_btn').click(); console.log("sendContent success!! " + content);} //根据上面说的API去获取自动回复的消息然后发给好友function getReplyMsg(sendMsg) { if (sendMsg != lastM) { console.log("begin send request !"); var para = "para=" + sendMsg; xmlHttpReg.open('post','http://www.xiaohuangji.com/ajax.php', true); xmlHttpReg.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); xmlHttpReg.onreadystatechange = doResult; xmlHttpReg.send(para); lastM = sendMsg; };}function doResult() { if (xmlHttpReg.readyState == 4) {//4代表执行完成 if (xmlHttpReg.status == 200) {//200代表执行成功 console.log("send success!! " + xmlHttpReg.responseText); sendContent(xmlHttpReg.responseText); } }}function doReply() { getReplyMsg(getLastMessage());} //每隔3秒执行一次~~var timerID = window.setInterval("doReply()",3000);
详细请见~
0 0
- 自动回复
- 精彩QQ自动回复
- qq自动回复
- 小黄鸡自动回复API
- nodejs 自动回复
- 论坛自动回复
- weiphp-自动回复消息
- 实现自动回复
- 微信自动回复
- 自动回复聊天机器人
- 利用outlook自动回复邮件
- Mac outlook设置自动回复
- 关于邮箱的自动回复
- Exchange外出自动回复设置
- javascript网页自动回复代码
- outlook 如何设置自动回复
- Mac outlook设置自动回复
- outlook 如何设置自动回复
- 致远App下载安装
- Cake
- vba excel编程三日谈(2)
- 在C语言中 i++与++i的区别
- NY 47 过河问题【贪心】
- 自动回复
- vba excel编程三日谈(3)
- PHP中调用python程序
- sqoop
- Java 数组类型(基本类型数组类型、封装类型数组类型、数组的数组类型)
- RDDAPI详解rdd数据模型及rdd的sql实现
- 18. Window createPopup() 方法
- 2015年多校联合训练第三场RGCDQ(hdu5317)
- 二叉树基本操作