Skip to content

Instantly share code, notes, and snippets.

class ResponseDataObject(object):
def __init__(self, mydict={}):
self._load_dict(mydict)
def __repr__(self):
return str(self)
def __str__(self):
return unicode(self).encode('utf-8')
import sys
def generate_results(result_set, columns=4):
total = sum([cnt+1 for ltr, cnt in result_set])
column_max = total / columns
column_count = 0
results = {}
bucket = 0
@timotheus
timotheus / gist:6055428
Created July 22, 2013 16:44
api.response_codes()
api.execute('VerifyAddItem', {})
if api.error():
# check for invalid data - error code 37
if 37 in api.response_codes():
print "Invalid data in request"
import requests
# http://docs.python-requests.org/en/latest/
headers = {'content-type': 'application/json'}
url = 'http://apps.testrunner.aeon-rc.dev.ebay.com/api/testrunner_v1/log/'
payload = {'a': 'b'}
r = requests.post(url,
data=json.dumps(payload),
headers=headers)