Created
April 29, 2021 21:39
-
-
Save ErikBoesen/026da14b3dc56ff539b5a86d3b0a0b69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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