zoukankan      html  css  js  c++  java
  • 微信网页版自动回复

    setInterval(function(){
    if ($(".js_message_plain").length == 0) {
       return;
    }
    var msg = $(".js_message_plain")[$(".js_message_plain").length-1].innerHTML;
    if (msg.indexOf("天气") > -1 ) {
           $.ajax({
                    type:"get",
                    url:"https://www.tianqiapi.com/api/?version=v1&city=南京",
                    success:function(responseData){console.log(responseData);
                        $('.edit_area').html("南京" + responseData.data[0].day +":" + responseData.data[0].wea + ",最高温度:" + responseData.data[0].tem1 + ",最低温度:" + responseData.data[0].tem2 + ",风速:" + responseData.data[0].win_speed + "。"+' '
                        + responseData.data[1].day +":" + responseData.data[1].wea + ",最高温度:" + responseData.data[1].tem1 + ",最低温度:" + responseData.data[1].tem2 + ",风速:" + responseData.data[1].win_speed + "。"+' '
                        + responseData.data[2].day +":" + responseData.data[2].wea + ",最高温度:" + responseData.data[2].tem1 + ",最低温度:" + responseData.data[2].tem2 + ",风速:" + responseData.data[2].win_speed + "。"+' '
                        + responseData.data[3].day +":" + responseData.data[3].wea + ",最高温度:" + responseData.data[3].tem1 + ",最低温度:" + responseData.data[3].tem2 + ",风速:" + responseData.data[3].win_speed + "。"+' '
                        + responseData.data[4].day +":" + responseData.data[4].wea + ",最高温度:" + responseData.data[4].tem1 + ",最低温度:" + responseData.data[4].tem2 + ",风速:" + responseData.data[4].win_speed + "。"+' '
                        + responseData.data[5].day +":" + responseData.data[5].wea + ",最高温度:" + responseData.data[5].tem1 + ",最低温度:" + responseData.data[5].tem2 + ",风速:" + responseData.data[5].win_speed + "。"+' '
                        + responseData.data[6].day +":" + responseData.data[6].wea + ",最高温度:" + responseData.data[6].tem1 + ",最低温度:" + responseData.data[6].tem2 + ",风速:" + responseData.data[6].win_speed + "。"
                        );
                        $(".edit_area").trigger($.Event("keydown", { keyCode: 13,ctrlKey: true}));
                        $('.btn_send').click();
     
                    }
                });
    }


    },300);


    $(".js_message_plain ng-binding").eq(0)

  • 相关阅读:
    电位器的使用
    序言
    跨域之options请求详解
    redis config 实现切库 和指定序列化
    巨坑! druid1.1.0
    跨域问题解决
    canal解决缓存穿透 对数据库同步数据至redis 或EleasticSearch
    oauth2+spring security +jwt 完成分布式服务认证
    oauth2的数据库设计
    Gson 转换 Localdate 使用 GsonBuilder setDateFormat 无效
  • 原文地址:https://www.cnblogs.com/jianwei-dai/p/10308321.html
Copyright © 2011-2022 走看看