“hi random whatsApp scammer….. oh, you have a website with a form that wants to collect data? how nice…. let me introduce you to my friend python…… my mac is burning up……. but so is their DB” “When you check your terminal window to see the status of the python job you wrote to pollute a scammers DB with fake info and you see that they finally blocked you after you threw ~12 million rows of garbage into their DB”
import random
import string
import requests
from faker import Faker
# Initialize Faker for data storm data generation
fake = Faker()
# API Endpoint
api_url = "API URL HERE"
# generate random IBAN
def generate_random_iban():
country_code = random.choice(["DE", "FR", "ES", "NL", "IT"])
check_digits = str(random.randint(10, 99))
bban = ''.join(random.choices(string.digits, k=18))
return country_code + check_digits + bban
# generate random test data
def generate_test_data():
return {
"first_name": fake.first_name(),
"last_name": fake.last_name(),
"address": fake.address(),
"email": fake.email(),
# Faker generates properly formatted email addresses
"phone_number": fake.phone_number(),
# Faker generates properly formatted phone numbers
"iban": generate_random_iban()
}
# send POST requests
def send_post_requests(batch_size=1000, total_records=1000000):
sent_records = 0
while sent_records < total_records:
batch_data = [generate_test_data() for _ in range(batch_size)]
for data in batch_data:
try:
response = requests.post(api_url, json=data)
if response.status_code == 200:
print(f"Successfully sent: {data}")
else:
print(f"Failed to send: {data},
Status Code: {response.status_code}")
except Exception as e:
print(f"Error sending data: {e}")
sent_records += batch_size
print(f"{sent_records}/{total_records} records sent.")
if __name__ == "__main__":
# Adjust batch_size and total_records as needed
send_post_requests(batch_size=100, total_records=1000)