Created
December 31, 2017 13:29
-
-
Save anonymous/6b7758a757108f8a7956132b969f46de to your computer and use it in GitHub Desktop.
automated push
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
#!/usr/bin/env python3 | |
import sys | |
import requests | |
if __name__ == '__main__': | |
s = requests.session() | |
for line in sys.stdin.readlines(): | |
name,uuid,comment = line.strip().split('\t') | |
url = 'https://uuid.pirate-server.com/{}'.format(uuid) | |
r = s.get(url) | |
csrfmiddlewaretoken = r.text.split("csrfmiddlewaretoken' value='")[1].split("'")[0] | |
r = s.post('https://uuid.pirate-server.com/comment',headers={'Referer':url},data={ | |
'csrfmiddlewaretoken':csrfmiddlewaretoken, | |
'title':name, | |
'details':comment, | |
'author':'automated push', | |
}) | |
print('{} {}'.format(uuid,name)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment