Advertisement
paster442

Comment Bot For Scratch

May 27th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.91 KB | None | 0 0
  1. # python
  2.  
  3. from scratchclient import ScratchSession # scratchclient by https://scratch.mit.edu/users/Raihan142857
  4. import requests
  5. import random as ra
  6. import time as t
  7.  
  8. session = ScratchSession("-Rix-", "goodpassword") # here goes your username and password
  9.  
  10. # the code below is by https://scratch.mit.edu/users/Hans5958/ from here: https://scratch.mit.edu/discuss/topic/435282
  11.  
  12. done = False
  13. offset = 0
  14. page = 1
  15. followers = []
  16.  
  17. while done == False:
  18.  
  19.   with requests.get(f"https://api.scratch.mit.edu/users/-Rix-/followers?offset={offset}") as request:
  20.     followers.extend(request.json())
  21.     if (len(request.json()) != 20):
  22.       done = True
  23.     else:
  24.       offset += 20
  25.       page += 1
  26.  
  27.  
  28. for follower in followers:
  29.     session.get_user(follower).post_comment("This is an automated message! RNTAS: " + str(ra.randint(1, 10000)) # this command posts a comment
  30.     t.sleep(2.5) # this is the comment cooldown
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement