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

多说评论机器人 #14

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

多说评论机器人 #14

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

Comments

@raclen
Copy link
Owner

raclen commented Sep 15, 2019

捣鼓了一个自动评论的东西,基于nodejs
主要代码

var Faker = require('faker-zh-cn');//随机生成中文名字
var request = require("request");
//多说评论
function autoDuoShuo() {
    var options=cloneObj(defOptions);
    var randomName = Faker.Name.findName();
    var email = Math.random().toString(8).substr(5);
    var submit = {
        thread_id: "1317975792122068993",
        parent_id: "",
        nonce: "568c7ef40c80c",
        message: "佛祖说"+randomName,
        author_name: randomName,
        author_email:email + "@163.com",
        v:"15.11.15"

    }
    var j = request.jar();
    var url_duoshuo = 'http://xxxx.duoshuo.com/api/posts/create.json';
    options.url = url_duoshuo, options.jar = j, options.method = 'POST', options.headers.Cookie = "duoshuo_unique=2f423fba75c68a2a";
    options.headers.Referer = "http://xxxxxx/message.html";
    options.headers.Host = "xxxxxx.duoshuo.com";
    options.headers.Origin = "http://xxxxxx";
    options.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
    options.form = submit;
    options.headers.Accept = "*/*";
    console.log(options);
    request(options, function (error, response, body) {
        console.log("autoDuoShuo=" + response.statusCode)
        if (!error && response.statusCode == 200) {
            console.log(body);
            sleep(1000);
            autoDuoShuo();
        }
    });
}

仅供学习之用,勿过分骚扰他人

#2016-02-04

多说已经不在了 #2019-09-15

@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