Skip to content

Instantly share code, notes, and snippets.

Created December 31, 2017 13:29
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 anonymous/6b7758a757108f8a7956132b969f46de to your computer and use it in GitHub Desktop.
Save anonymous/6b7758a757108f8a7956132b969f46de to your computer and use it in GitHub Desktop.
automated push
#!/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