最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

自动回复

IT圈 admin 27浏览 0评论

自动回复

注: 这里说的自动回复是依赖第三方 API的

我这里用的API是 www.xiaohuangji.com
它的API(API我自己用chrome console 看的)有两种 POSTGET

POST

type : post
url: .php
参数: para

GET

Type : get
.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','.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);

详细请见~

自动回复

注: 这里说的自动回复是依赖第三方 API的

我这里用的API是 www.xiaohuangji.com
它的API(API我自己用chrome console 看的)有两种 POSTGET

POST

type : post
url: .php
参数: para

GET

Type : get
.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','.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);

详细请见~

Error[2]: Trying to access array offset on value of type int, File: /www/wwwroot/www.usbmi.com/xiunophp/xiunophp.min.php, Line: 54
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 1095, humandate(1734920519)
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 662, well_thread_format(array(26))
File: /www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm, Line: 249, well_thread_find_asc(array(3) , 3)
File: /www/wwwroot/www.usbmi.com/tmp/route_read.php, Line: 204, include(/www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm)
File: /www/wwwroot/www.usbmi.com/tmp/index.inc.php, Line: 129, include(/www/wwwroot/www.usbmi.com/tmp/route_read.php)
File: /www/wwwroot/www.usbmi.com/index.php, Line: 29, include(/www/wwwroot/www.usbmi.com/tmp/index.inc.php)
Error[2]: Trying to access array offset on value of type int, File: /www/wwwroot/www.usbmi.com/xiunophp/xiunophp.min.php, Line: 54
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 1096, humandate(1734920519)
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 662, well_thread_format(array(27))
File: /www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm, Line: 249, well_thread_find_asc(array(3) , 3)
File: /www/wwwroot/www.usbmi.com/tmp/route_read.php, Line: 204, include(/www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm)
File: /www/wwwroot/www.usbmi.com/tmp/index.inc.php, Line: 129, include(/www/wwwroot/www.usbmi.com/tmp/route_read.php)
File: /www/wwwroot/www.usbmi.com/index.php, Line: 29, include(/www/wwwroot/www.usbmi.com/tmp/index.inc.php)
Error[2]: Trying to access array offset on value of type int, File: /www/wwwroot/www.usbmi.com/xiunophp/xiunophp.min.php, Line: 54
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 1095, humandate(1738297454)
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 662, well_thread_format(array(26))
File: /www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm, Line: 249, well_thread_find_asc(array(3) , 3)
File: /www/wwwroot/www.usbmi.com/tmp/route_read.php, Line: 204, include(/www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm)
File: /www/wwwroot/www.usbmi.com/tmp/index.inc.php, Line: 129, include(/www/wwwroot/www.usbmi.com/tmp/route_read.php)
File: /www/wwwroot/www.usbmi.com/index.php, Line: 29, include(/www/wwwroot/www.usbmi.com/tmp/index.inc.php)
Error[2]: Trying to access array offset on value of type int, File: /www/wwwroot/www.usbmi.com/xiunophp/xiunophp.min.php, Line: 54
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 1096, humandate(1738297454)
File: /www/wwwroot/www.usbmi.com/tmp/model_thread.func.php, Line: 662, well_thread_format(array(27))
File: /www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm, Line: 249, well_thread_find_asc(array(3) , 3)
File: /www/wwwroot/www.usbmi.com/tmp/route_read.php, Line: 204, include(/www/wwwroot/www.usbmi.com/tmp/view_template_d8_htm_read.htm)
File: /www/wwwroot/www.usbmi.com/tmp/index.inc.php, Line: 129, include(/www/wwwroot/www.usbmi.com/tmp/route_read.php)
File: /www/wwwroot/www.usbmi.com/index.php, Line: 29, include(/www/wwwroot/www.usbmi.com/tmp/index.inc.php)
发布评论

评论列表 (0)

  1. 暂无评论