1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Disqus upvote bot tester

Discussion in 'Scripting' started by Triggakb24, Mar 19, 2017.

  1. Triggakb24

    Triggakb24 Newbie

    Joined:
    Mar 19, 2017
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    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.
     
  2. Triggakb24

    Triggakb24 Newbie

    Joined:
    Mar 19, 2017
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    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
     
  3. CyberGenie

    CyberGenie Registered Member

    Joined:
    Feb 3, 2015
    Messages:
    51
    Likes Received:
    13
    Gender:
    Male
    I am gonna test this out a little later and message you with the prognosis. ;)
     
  4. Triggakb24

    Triggakb24 Newbie

    Joined:
    Mar 19, 2017
    Messages:
    15
    Likes Received:
    1
    Gender:
    Male
    How did it work