Last active
March 27, 2021 14:48
-
-
Save FaltoGH/4977c2f51de14edcd8762c795304e38e to your computer and use it in GitHub Desktop.
Padlet Like Control
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 | |
wish_id = 1276665214 | |
url2 = 'https://padlet.com/0x5067b10/0' | |
def main(x): | |
url = 'https://padlet.com/api/5/reactions' | |
payload = { | |
'wish_id': wish_id, | |
'value': 1, | |
'reaction_type': "like"} | |
keyword = '<meta name="csrf-token" content="' | |
for _ in [0] * x: | |
s = requests.Session() | |
response = s.get(url2) | |
html = response.text | |
index = html.find(keyword) | |
index += len(keyword) | |
csrf_token = html[index:].split('"')[0] | |
headers = { | |
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.190 Safari/537.36', | |
'x-csrf-token': csrf_token} | |
response = s.post(url, payload, headers=headers) | |
print(response.status_code) | |
return None | |
if __name__ == '__main__': | |
main(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment