jquery使用ajax实现微信自动回复插件


var _autorun;
var str = new Array('转发什么','分享什么','已转发','已轉發','己转发','继续申请','在不','已发送','以转发','以分享','已分享','yv','bv','gv','pv','rv','你好','美女','索要','代码','我要','要v','要加v');
var isrun = false;
var i=0;
function start(){
    console.log('第'+(++i)+'次刷新');
    var chatListColumn =$(".chatListColumn");
    chatListColumn.each(function(){
        var _this = this;
        var _me = $(this);
        var attr = $(this).attr('un');
        if((attr!='')&&(attr!='filehelper')&&(attr!='weixin')&&(attr!='newsapp')&&(attr!='fmessage')){
            //console.log($(this).attr('un'));
            var disp =  _me.find('p.desc').html();
            disp = disp.toLowerCase();
            disp = disp.trim();
            for (var i = 0; i < str.length; i++){
                if(disp.indexOf(str[i])!=-1){
                    isrun=true;break;
                }
            };
           if(disp.indexOf('你已添加了')!=-1||disp.indexOf('通过了你的好友验证请求')!=-1||disp.indexOf('你添加到通讯录')!=-1){
                _this.click();
                var _input = $("#textInput");
                var  message = _ajax('你已添加了',attr);
                _input.val(message);
                var _click = document.getElementsByClassName("chatSend");
                _click[0].click();
                isrun=false;
            }
            else if((disp.indexOf('发送好友验证请求')!=-1)&&disp!=''){
                isrun=false;
            }
            else if((disp.indexOf('仔细阅读上述消息')!=-1)&&disp!=''){
                isrun=false;
            }
            else if(disp!=''){
               isrun=false;
           }
            //console.log(disp);
            /*if(isrun){
                _this.click();
                var _input = $("#textInput");
                var  message = _ajax(disp,attr);
                _input.val(message);
                var _click = document.getElementsByClassName("chatSend");
                _click[0].click();
                isrun=false;
            }
            else if(disp.indexOf('你添加到通讯录')!=-1){
                _this.click();
                var _input = $("#textInput");
                var  message = _ajax('你添加到通讯录',attr);
                _input.val(message);
                var _click = document.getElementsByClassName("chatSend");
                _click[0].click();
                isrun=false;
            }
            else if(disp.indexOf('你已添加了')!=-1||disp.indexOf('通过了你的好友验证请求')!=-1){
                _this.click();
                var _input = $("#textInput");
                var  message = _ajax('你已添加了',attr);
                _input.val(message);
                var _click = document.getElementsByClassName("chatSend");
                _click[0].click();
                isrun=false;
            }
            else if((disp.indexOf('发送好友验证请求')!=-1)&&disp!=''){
                isrun=false;
            }
            else if((disp.indexOf('仔细阅读上述消息')==-1)&&disp!=''){
                _this.click();
                var _input = $("#textInput");
                var  message = _ajax('other',attr);
                _input.val(message);
                var _click = document.getElementsByClassName("chatSend");
                _click[0].click();
                isrun=false;
            }*/

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgppsd.html