Disqus upvote bot tester

Triggakb24

Newbie
Joined
Mar 19, 2017
Messages
15
Reaction score
1
Code:
    import requests
    import random
    import string
    import threadpool
    import thread
    def gen(size=10, chars=string.ascii_uppercase + string.digits):
        return ''.join(random.choice(chars) for x in range(size))
    class Disqus:
        def __init__(self):
            print "Disqus Class Initialized"
            self.signup = "https://disqus.com/profile/signup/"
            self.http = requests.Session()
        def createAccount(self,email,username,password):
            pdata = {
                "email" : email,
                "username" : username,
                "password" : password
            }
            signup_headers = {
                "referer" : "https://disqus.com/profile/signup/",
                "content-type" : "application/x-www-form-urlencoded",
                ":host" : "disqus.com",
                ":method" : "POST",
                ":path" : "/profile/signup/",
                ":scheme" : "https",
                ":version" : "HTTP/1.1"
            }
             r = self.http.post(self.signup, data = pdata, headers = signup_headers)
            if r.status_code == 302:
                print "Good signup"
            else:
                print "Bad signup"
            #look for this in r.headers
            #x-user:loginas:None:108281152
        def upvote(self,postid):
            pdata = {
                "post" : postid,
                "vote" : "1",
                "api_key" : "E8Uh5l5fHZ6gD8U3KycjAIAk46f68Zw7C6eW8WSjZvCLXebZ7p0r1yrYDrLilk2F"
            }
            r =     self.http.post("http://disqus.com/api/3.0/posts/vote.json",data = pdata)
            print r.content

    def rape(stack):
        dis,u,target = stack
        dis.createAccount(u+"@mailinator.com",u,u)
        print u
        print "Upvoting..."
        dis.upvote(target)

    if __name__ == "__main__":
        target = "1399861984"
        pool = threadpool.ThreadPool(100)
        queue_arguments = []
        for i in range(0,10):
            dis = Disqus()
            u = gen(10)
            queue_arguments.append([dis,u,target])
        request = threadpool.makeRequests(rape, queue_arguments)
        for req in request:
            pool.putRequest(req)
        pool.wait()


Would like someone to verify the functionality of this program. It should upvote your comment using the script. Should be run in cmd with the imported header files in the same folder.
 
Also replace email and password with an existing account to test with.

Note: the API Key may need to be updated with dosqus api website
 
I am gonna test this out a little later and message you with the prognosis. ;)
 
Did you use python 2 or 3?

And for those who want to test, first install the dependencies:
Code:
pip3 install request
pip3 install threadpool
pip3 install thread
 
Back
Top