Skip to content

Instantly share code, notes, and snippets.

@ErikBoesen
Created April 29, 2021 21:39
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 ErikBoesen/026da14b3dc56ff539b5a86d3b0a0b69 to your computer and use it in GitHub Desktop.
Save ErikBoesen/026da14b3dc56ff539b5a86d3b0a0b69 to your computer and use it in GitHub Desktop.
import requests
cookies = {
'csrftoken': 'oMf6Oy9UmwlpCtveOB3bo4S1aU0t5Mv5n6HSyxx0NhF9D7AiQG9ORerg3QIJTz84',
'sessionid': '4w8ipimaz3h57dpr19693xe5juvtmkck',
}
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:89.0) Gecko/20100101 Firefox/89.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Referer': 'https://www.studyup.xyz/s/group/35',
'Content-Type': 'application/x-www-form-urlencoded',
'Origin': 'https://www.studyup.xyz',
'DNT': '1',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'same-origin',
'Sec-Fetch-User': '?1',
'Pragma': 'no-cache',
'Cache-Control': 'no-cache',
}
with open('anna.txt', 'r') as f:
anna = f.read()
data = {
'csrfmiddlewaretoken': 'kgtCqOKeQBJJOlUE63JBJS0qIBwBhzhajAVoaN8khm3tPZZI88Pec2zFBxeR5mU9',
'contents': 'Testing message. Here\'s Anna Karenina by Leo Tolstoy: ' + anna,
'form_name': 'comment'
}
response = requests.post('https://www.studyup.xyz/s/put_comment/35', headers=headers, cookies=cookies, data=data)
print(response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment