· 6 years ago · Sep 02, 2019, 01:42 AM
1import random
2import time
3import requests
4import json
5
6names = json.loads(open("names.json").read())
7messages = json.loads(open("words.json").read())
8
9for username in names:
10 username = username.lower() + str(random.randint(100, 999))
11 password = username + "#(&43354"
12 email = username + "@gmail.com"
13
14 registerData = json.dumps({
15 "email": email,
16 "username": username,
17 "password": password
18 })
19
20 r = requests.post("https://sprx.io/api/auth/register", headers={"Content-Type": "application/json;charset=UTF-8"}, data=registerData)
21
22 data = r.json()
23
24 uid = data['user']['id']
25
26 message = random.choice(messages)
27
28 messageData = json.dumps({
29 "uid": uid,
30 "shout": message,
31 "username": username,
32 "userRank": 1
33 })
34 print("\nCreated User:\n")
35 print("Username: " + username)
36 print("Email: " + email)
37 print("Password: " + password)
38 print("User ID: " + str(uid))
39
40 requests.post("https://sprx.io/api/shouts/post", headers={"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyYW5rIjoxLCJoYXNNVzIiOmZhbHNlLCJoYXNNVzMiOmZhbHNlLCJoYXNCTzIiOmZhbHNlLCJoYXNCTzEiOmZhbHNlLCJodkhhc2giOiIiLCJQU0lEIjoiIiwiaWQiOjk5MiwiZW1haWwiOiJqb2huc2V4QGdtYWlsLmNvbSIsInVzZXJuYW1lIjoiR29kbHlCb3RzIiwiaWF0IjoxNTY3MzU1Nzc1LCJleHAiOjE1Njc5NjA1NzV9.t0pPZroml7BAT3cunl25ETwEspeVwdI7p5EFobMfDF0","Content-Type": "application/json;charset=UTF-8", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36"}, data=messageData)
41 #print("Successfully created " + username + " with ID " + str(uid) + " and sent '" + message + "'")
42 time.sleep(3)