Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

机器注册账号 #15

Open
raclen opened this issue Sep 15, 2019 · 0 comments
Open

机器注册账号 #15

raclen opened this issue Sep 15, 2019 · 0 comments
Labels
博客搬迁 以前博客的文章迁移过来

Comments

@raclen
Copy link
Owner

raclen commented Sep 15, 2019

下面这段代码,用于自动注册账号

//自动注册
function autoReg(){
    var email = Math.random().toString(8).substr(5);
    var pw = Math.random().toString(36).substr(8);
    var pLogin = {
        username: pw,
        password: pw,
        repassword: pw,
        sskey:"salanghae",
        email: email + "@163.com"
    };
    var j = request.jar();
    var url_register = 'http://third-contact.com/ss/Account/User/register';
    options.url=url_register,options.jar=j,options.method= 'POST', options.headers.Cookie="__session:0.9360456641297787:=http:;thinkphp_show_page_trace=0|0; PHPSESSID=c1kr9fes4lfjh044svdup3t183";
    options.headers.Referer="http://third-contact.com/ss";
    options.headers.Host="third-contact.com";
    options.headers["X-Requested-With"]= "XMLHttpRequest"
    options.headers.Origin="http://third-contact.com"
    options.headers["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8";
    //console.log(options);
    options.form=pLogin;
    request(options, function (error, response, body) {
        console.log("login2="+response.statusCode)
        if (!error && response.statusCode == 200) {
            console.log(body);
            //sleep(500)
            //autoReg()
        }
    });
}

测试可用,仅供学习http之用

#2016-02-04

@raclen raclen added the 博客搬迁 以前博客的文章迁移过来 label Sep 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
博客搬迁 以前博客的文章迁移过来
Projects
None yet
Development

No branches or pull requests

1 participant