Skip to content

Commit 3156c07

Browse files
committed
add motors sample query
1 parent e0ee1f1 commit 3156c07

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

samples/finding.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,29 @@ def run2(opts):
7474
print(e)
7575
print(e.response.dict())
7676

77+
def run_motors(opts):
78+
api = finding(siteid='EBAY-MOTOR', debug=opts.debug, appid=opts.appid, config_file=opts.yaml,
79+
warnings=True)
7780

81+
api.execute('findItemsAdvanced', {
82+
'keywords': 'tesla',
83+
})
84+
85+
if api.error():
86+
raise Exception(api.error())
87+
88+
if api.response_content():
89+
print "Call Success: %s in length" % len(api.response_content())
90+
91+
print "Response code: %s" % api.response_code()
92+
print "Response DOM: %s" % api.response_dom()
93+
94+
dictstr = "%s" % api.response_dict()
95+
print "Response dictionary: %s..." % dictstr[:250]
96+
7897
if __name__ == "__main__":
7998
print("Finding samples for SDK version %s" % ebaysdk.get_version())
8099
(opts, args) = init_options()
81100
run(opts)
82101
run2(opts)
102+
run_motors(opts)

0 commit comments

Comments
 (0)