ITPub博客

首页 > 移动开发 > 微信开发 > 微信域名检测批量检测api接口分享(附上html代码)

微信域名检测批量检测api接口分享(附上html代码)

原创 微信开发 作者:luojing0417 时间:2021-05-27 15:48:44 2 删除 编辑

由于业务需要微信推广,域名时不时被屏蔽或拦截已司空见惯,因此在推广前域名检测很有必要。之前写过单个域名检测php和python代码,考虑到批量检测需求还挺大,况且批量操作会比单个检测方便,在技术实现难度也会打很多。作为一名程序猿熊熊燃气,在开发过程中写得判断较多费了不少脑子,好在已完成。


API接口实现

<!--api对接组件 -->
<div class="panel" style="background:#0f8ee7">
        <div class="panel_inner">
                <div class="promo">
                        <!--标题 -->
                        <h2 style="color:#fff">微信域名批量检测</h2>
                </div>
                <div class="form1">
                        <!--输入框,可自己调节大小 -->
                        <textarea class="main-textarea" placeholder="请输入需要检测的链接,一行一个" type="text" id="text" name="text" value="" size="20" style="height:360px;width:100%"></textarea>        
                        <!--提交 -->
                        <button type="button" id="btn-tcn" class="main-button" onclick="wxcheck_form()">批量检测</button>
                </div>
                <!--输出结果 -->
                <div id="result_panel"></div>
        </div>
</div>


js调用

<script src="
<script src="



主方法实现

<script>
var notice_msg = '微信域名检测';
var api_host = '
function wxcheck_form(){
$("#result_panel").hide();
var url_longs = $("#text").val();
if(!url_longs) {
alert('输入格式不正确!');
return false;
}
$.post(api_host+"/"+"wxcheck/web_panel", {url_longs:url_longs},function(result){
$('#result_panel').html(result);
$("#result_panel").show();
wxcheck_handdle();
});
return false;
}
    function wxcheck_handdle() {
        var wxcheck_api_url = '值(后台生成获取)&amp;url=';//检测接口,后台地址:
        var em = $("*[data='-']:eq(0)");
        if(em.length&gt;0) {
            em.attr('data','loading');
            em.html('&lt;img src="https://tigimg-1252093452.image.myqcloud.com/2020/04/22/i15fEBcCzV7lpvOjyLfX.gif" /&gt;');
            $.get(wxcheck_api_url+em.attr('url-long'),function(result){
                if(result.indexOf('正常')&gt;-1) {
                    em.html('&lt;span class="opt-result-ok" style="color:green;"&gt;域名正常&lt;/span&gt;');
                    wxcheck_handdle();
                } else if(result.indexOf('被封')&gt;-1) {
                    em.html('&lt;span class="opt-result-fail"&gt;域名被封&lt;/span&gt;');
                    wxcheck_handdle();
                } else if(result.indexOf('异常,查看原因')&gt;-1) {
                    em.html('&lt;span class="opt-result-fail"&gt;接口到期,点击:&lt;a href="查看原因&lt;/span&gt;');
                    wxcheck_handdle();
                } else {
                    em.html('&lt;span class="opt-result-fail"&gt;'+result+'&lt;/span&gt;');
                    wxcheck_handdle();
                }
            });
        }
    }
</script>


完整代码

下载地址: https://  fqlq4dbcak.feishu.cn/docs/doccnUa4D9GT4eHFiSBNrKStXUd



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69993190/viewspace-2774268/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2021-01-13

  • 博文量
    8
  • 访问量
    4735