def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
global _opener
if _opener is None:
_opener = build_opener()
return _opener.open(url, data, timeout)
def do_zip_post(self):
# automatically acquires a post url
u = urllib2.urlopen(serviceurl, data="any")
h = json.loads(u.read())
posturl = h["post_url"]
redirect_url = h["redirect_url"]
src/n/o/notmm-0.4.1/examples/lib/payment/modules/paypal/views.py notmm(Download)
req = urllib2.Request(PP_URL)
req.add_header("Content-type", "application/x-www-form-urlencoded")
fo = urllib2.urlopen(req, params)
ret = fo.read()
if ret == "VERIFIED":
src/r/d/Rdbhdb-HEAD/examples/get_no_series_terms.py Rdbhdb(Download)
# Direct connection; Not through API; Prints rows of tables accounts and branches from urllib import urlencode from urllib2 import Request, urlopen url = 'http://rdbhost.com/db/'+'s000015' authcode = 'KF7IUQPlwfSth4sBvjdqqanHkojAZzEjMshrkfEV0O53yz6w6v'
flds1 = [ ('q', x1),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds1)
req.add_data(postdata)
pg=urlopen(req)
text=pg.read()
print text
'''
flds1 = [ ('q', x1),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds1)
req.add_data(postdata)
pg=urlopen(req)
text=pg.read()
print text
src/r/d/Rdbhdb-HEAD/examples/ex4.py Rdbhdb(Download)
# Direct connection; Not through API; Creates table test and then deletes it. from urllib import urlencode from urllib2 import Request, urlopen url = 'http://rdbhost.com/db/'+'s000015' authcode = 'KF7IUQPlwfSth4sBvjdqqanHkojAZzEjMshrkfEV0O53yz6w6v'
flds1 = [ ('q', q1),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds1)
req.add_data(postdata)
pg=urlopen(req)
text=pg.read()
print text
flds2 = [ ('q', q2),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds2)
req.add_data(postdata)
pg=urlopen(req)
src/r/d/Rdbhdb-HEAD/examples/ex10.py Rdbhdb(Download)
# Direct connection; Not through API; Prints rows of tables accounts and branches from urllib import urlencode from urllib2 import Request, urlopen url = 'http://rdbhost.com/db/'+'s000015' authcode = 'KF7IUQPlwfSth4sBvjdqqanHkojAZzEjMshrkfEV0O53yz6w6v'
flds1 = [ ('q', 'SELECT * FROM accounts'),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds1)
req.add_data(postdata)
pg=urlopen(req)
text=pg.read()
print text
flds2 = [ ('q', 'SELECT * FROM branches'),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds2)
req.add_data(postdata)
pg=urlopen(req)
src/r/d/Rdbhdb-HEAD/examples/get_no_table_rows.py Rdbhdb(Download)
# Direct connection; Not through API; Prints rows of tables accounts and branches from urllib import urlencode from urllib2 import Request, urlopen url = 'http://rdbhost.com/db/'+'s000015' authcode = 'KF7IUQPlwfSth4sBvjdqqanHkojAZzEjMshrkfEV0O53yz6w6v'
flds1 = [ ('q', q),('format','xml'),('authcode',authcode)]
postdata = urlencode(flds1)
req.add_data(postdata)
pg=urlopen(req)
text=pg.read()
print text
src/r/d/Rdbhdb-HEAD/examples/ex9.py Rdbhdb(Download)
# Testing Exception Raising. Direct connection (not through API)
from urllib import urlencode
from urllib2 import Request, urlopen
import json
def postit(url,fields):
postdata = urlencode(fields)
headers = {'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': str(len(postdata))}
r = Request(url, postdata, headers)
pg = urlopen(r)
src/g/r/Groovepy-HEAD/example.py Groovepy(Download)
ip = result['ip']
streamkey = result['streamKey']
data = 'streamKey=%s' % (streamkey, )
resp = urllib2.urlopen('http://%s/stream.php' % (ip,), data)
rawfile = '%s.mp3' % (song_info['song_name'],)
f = open(rawfile, 'wb')
f.write(resp.read())
src/n/o/notmm-0.4.1/examples/lib/payment/modules/cybersource/processor.py notmm(Download)
request = t.render(c)
conn = urllib2.Request(url=self.connection, data=request)
try:
f = urllib2.urlopen(conn)
except urllib2.HTTPError, e:
# we probably didn't authenticate properly
# make sure the 'v' in your account number is lowercase
return ProcessorResult(self.key, False, 'Problem parsing results')
f = urllib2.urlopen(conn)
src/n/o/notmm-0.4.1/examples/lib/payment/modules/authorizenet/processor.py notmm(Download)
headers = {'Content-type':'text/xml'}
conn = urllib2.Request(data['connection'], request, headers)
try:
f = urllib2.urlopen(conn)
all_results = f.read()
except urllib2.URLError, ue:
self.log.error("error opening %s\n%s", data['connection'], ue)
conn = urllib2.Request(url=data['connection'], data=data['postString'])
try:
f = urllib2.urlopen(conn)
all_results = f.read()
self.log_extra('Authorize response: %s', all_results)
except urllib2.URLError, ue:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next