Friday, January 15, 2016

Dhe malet Oshtine


import urllib, urllib2, os, sys, cgi
_GET = cgi.parse_qs(os.environ.get('QUERY_STRING',''))
key_id = 250715
params = {'s_key' : key_id,
's_pair' : _GET.get('s_pair', [''])[0][:10],
's_language' : _GET.get('s_language', [''])[0][:10],
's_ip' : os.environ.get('REMOTE_ADDR', ''),
's_url' : "%s%s" % (os.environ.get('HTTP_HOST', ''), os.environ.get('REQUEST_URI',''))
}
opener = urllib2.Request("http://key.smscoin.com/language/english/key/?%s" % urllib.urlencode(params),
headers = {'User-agent': 'smscoin_key_1.0.6'})
try:
response = urllib2.urlopen(opener).read()
except:
response = 'Не удалось запросить внешний сервер'
if (response[:4] != 'true'):
print "Content-type: text/html\n\n";
print response
sys.exit()

No comments:

Post a Comment