Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2017
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. #This script will start drawing yellow over the Hammer and Sickle
  2. #Download and install python 2.7.13
  3. #Put this script in a file anywhere. Name it "anything.py"
  4. #Right click the file and select Edit with IDLE
  5. #Hit F5
  6. #Enter your accountname:password
  7. #Enter done when all accounts entered
  8.  
  9. import urllib
  10. import urllib
  11. import urllib2
  12. import time
  13. import json
  14. import random
  15.  
  16. print "Build the Void"
  17.  
  18. print "Getting user agent list for anonymity (please wait)"
  19. user_agent_list=list(set([ua for ua in urllib.urlopen("https://raw.githubusercontent.com/sqlmapproject/sqlmap/master/txt/user-agents.txt").read().splitlines() if not ua.startswith("#")]))
  20.  
  21. accounts = []
  22. sessions = {}
  23. print "For each account you want to use, enter it in like username:password"
  24. print "When you're done, type 'done'"
  25. user_input = ""
  26. while (user_input != "done"):
  27. user_input = raw_input("Account-> ")
  28. if user_input.lower() != "done":
  29. accounts.append(user_input)
  30.  
  31. opener = urllib2.build_opener()
  32. opener.addheaders = [('User-Agent', random.choice(user_agent_list))]
  33. for account in accounts:
  34. username = account.split(":")[0]
  35. password = account.split(":")[1]
  36. data = urllib.urlencode({'op': 'login-main', 'user': username, 'passwd': password, 'api_type': 'json'})
  37. resp = opener.open('https://www.reddit.com/api/login/'+urllib.quote(username), data).read()
  38. sessions[username] = json.loads(resp)["json"]["data"]["cookie"]
  39.  
  40. def paint_black(xtest,ytest):
  41. try:
  42. data = urllib.urlencode({'x': xtest, 'y': ytest, 'color': void_color})
  43. newopener = urllib2.build_opener()
  44. newopener.addheaders = [('User-Agent', random.choice(user_agent_list))]
  45. newopener.addheaders.append(('Cookie', 'reddit_session='+cookie))
  46. modhash = json.loads(newopener.open("https://reddit.com/api/me.json").read())["data"]["modhash"]
  47. newopener.addheaders.append(('x-modhash', modhash))
  48. next=newopener.open("https://www.reddit.com/api/place/draw.json", data).read()
  49. print next
  50. finalresp = newopener.open("https://www.reddit.com/api/place/pixel.json?x="+str(xtest)+"&y="+str(ytest)).read()
  51. return finalresp
  52. except urllib2.HTTPError:
  53. print 'skipping'
  54.  
  55. print "Running Build the Void"
  56. void_color = 8 # 3 black 5 Red 6 Orange 8 Yellow
  57. center = [17, 426] # x,y of center of void
  58. while True:
  59. # Fill the void
  60. for session in sessions.keys():
  61. cookie = sessions[session]
  62. color = 8
  63. counter = 8
  64. while color == void_color:
  65. cx=[ x for x in range(center[0]-counter,center[0]+counter) ]
  66. cy=[ x for x in range(center[1]-counter,center[1]+counter) ]
  67. checklist = []
  68. for x in cx:
  69. for y in cy:
  70. checklist.append((x,y))
  71. random.shuffle(checklist)
  72. for check in checklist:
  73. # Find a non-black square
  74. xtest = check[0]
  75. ytest = check[1]
  76. resp = opener.open("https://www.reddit.com/api/place/pixel.json?x="+str(xtest)+"&y="+str(ytest)).read()
  77. try:
  78. color = int(json.loads(resp)["color"])
  79. except Exception, e:
  80. print "Exception"
  81. print resp
  82. color = 8
  83. if color != void_color:
  84. break
  85. counter += 10
  86. print "Found a non-void color at", xtest, ytest
  87. print 'https://www.reddit.com/r/place/#x=%s&y=%s' % (xtest, ytest)
  88. finalresp = paint_black(xtest,ytest)
  89. if finalresp:
  90. if session in finalresp:
  91. print "Added successfully"
  92. else:
  93. print finalresp
  94. time.sleep(305)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement