Skip to content

Instantly share code, notes, and snippets.

@princefishthrower
Created January 9, 2023 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save princefishthrower/67e5977033b9e1daf3dedc06e053c5dd to your computer and use it in GitHub Desktop.
Save princefishthrower/67e5977033b9e1daf3dedc06e053c5dd to your computer and use it in GitHub Desktop.
A 50 line script illustrating the ease of botnets to exploit spam on sites like substack.
# Best run with "scrapy runspider asshats.py --nolog" in your terminal
import time
import scrapy
from selenium import webdriver
# Variables needed - or, throw this garbage in a loop to produce ultimate ass-hattery
url = "https://somesubstackurl.substack.com/"
email = "someemail@gmail.com"
class MyAsshatSpider(scrapy.Spider):
name = "asshat"
start_urls = [url]
def __init__(self):
self.driver = webdriver.Firefox()
def parse(self, response):
self.driver.get(response.url)
time.sleep(1)
# type email into input box
self.driver.find_element("xpath", '//div[@class="sideBySideWrap"]/input[@type="email"]').send_keys(email)
time.sleep(2)
# Click submit button
self.driver.find_element("xpath", '//button[@type="submit"]').click()
# Wait for next page
time.sleep(2)
# Click no pledge option
self.driver.find_element("xpath", '//div[text()="No pledge"]/preceding-sibling::input').click()
time.sleep(2)
# Click subscribe button
self.driver.find_element("xpath", '//button[@type="button"]').click()
# Wait for next page
time.sleep(2)
# Click maybe later button
self.driver.find_element("xpath", '//button[@type="button"]').click()
# Wait at bit for aesthetic purposes
time.sleep(2)
# Close the browser
self.drive.close()
print("Done! Subscription to site " + url + " with email " + email + " has been added.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment