mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
Added this stuff.
This commit is contained in:
parent
bae578b5d7
commit
0fb8962b14
2 changed files with 30 additions and 0 deletions
14
example.py
Normal file
14
example.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
import urllib2
|
||||
|
||||
def executeHttpRequest(url, agent, **extras):
|
||||
request = urllib2.Request('http://127.0.0.1:45749/' + url)
|
||||
request.add_header('User-Agent', 'TTU-' + agent)
|
||||
request.add_header('Secret-Key', '1X5oN69^#0^fCw7s#uyQTWYJ!8m9z!6Midphf90gMQYl*L5Uy!Ri5KTP6@BbZ5#Tlm37bJAI')
|
||||
for k, v in extras.items():
|
||||
request.add_header(k, v)
|
||||
try:
|
||||
return urllib2.urlopen(request).read()
|
||||
except:
|
||||
return None
|
||||
|
||||
print executeHttpRequest('ban', 'Game', username='dev', enddate=1428408418062, comment='asshole')
|
16
gentoken.py
Normal file
16
gentoken.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import urllib2
|
||||
|
||||
def executeHttpRequest(url, agent, **extras):
|
||||
request = urllib2.Request('http://127.0.0.1:45749/' + url)
|
||||
request.add_header('User-Agent', 'TTU-' + agent)
|
||||
request.add_header('Secret-Key', '1X5oN69^#0^fCw7s#uyQTWYJ!8m9z!6Midphf90gMQYl*L5Uy!Ri5KTP6@BbZ5#Tlm37bJAI')
|
||||
for k, v in extras.items():
|
||||
request.add_header(k, v)
|
||||
try:
|
||||
return urllib2.urlopen(request).read()
|
||||
except:
|
||||
return None
|
||||
|
||||
print executeHttpRequest('register', 'Site', ip='69.69.69.69', username='dev', password='user', email='dev@dev.net', accesslevel=0)
|
||||
print executeHttpRequest('email', 'Site', email='dev@dev.net')
|
||||
print executeHttpRequest('login', 'Player', username='dev', password='user')
|
Loading…
Reference in a new issue