Skip to content

Instantly share code, notes, and snippets.

@Shugabuga
Created July 14, 2020 06:05
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 Shugabuga/eb62ec9b8e63fa638cb8df7d55da5c80 to your computer and use it in GitHub Desktop.
Save Shugabuga/eb62ec9b8e63fa638cb8df7d55da5c80 to your computer and use it in GitHub Desktop.
Pretend You're Xyzzy bulk uploader.
import requests, csv, time
def main():
print("Cards Against Uploader")
with open("inp.csv", "r") as file:
file = csv.reader(file, delimiter=',')
for row in file:
if row[0] is not "color":
upload(row[0], row[1], "NYA", row[3], row[2])
time.sleep(7)
def upload(color, text, watermark, pick, draw):
url = 'https://example.com'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': url,
'DNT': '1',
'Connection': 'keep-alive',
'Referer': url + '/addcard.jsp',
}
data = {
'color': color,
'text': text,
'watermark': watermark,
'pick': pick,
'draw': draw
}
response = requests.post(url + '/addcard.jsp', headers=headers, data=data)
print()
print("POSTed: " + text + " [" + str(response.status_code) + "]")
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment