def memberMessages(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid, warnings=True) now = datetime.datetime.now() memberData = { "WarningLevel": "High", "MailMessageType": "All", # "MessageStatus": "Unanswered", "StartCreationTime": now - datetime.timedelta(days=60), "EndCreationTime": now, "Pagination": { "EntriesPerPage": "5", "PageNumber": "1" } } api.execute('GetMemberMessages', memberData) dump(api) if api.response_dict().MemberMessage: messages = api.response_dict().MemberMessage.MemberMessageExchange if type(messages) != list: messages = [ messages ] for m in messages: print("%s: %s" % (m.CreationDate, m.Question.Subject[:50])) except ConnectionError as e: print e
def run(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid) api.execute('GetCharities', {'CharityID': 3897}) dump(api) print(api.response_dict().Charity.Name) except ConnectionError as e: print e
def memberMessages(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid, warnings=True) now = datetime.datetime.now() memberData = { "WarningLevel": "High", "MailMessageType": "All", # "MessageStatus": "Unanswered", "StartCreationTime": now - datetime.timedelta(days=60), "EndCreationTime": now, "Pagination": { "EntriesPerPage": "5", "PageNumber": "1" } } api.execute('GetMemberMessages', memberData) dump(api) if api.response_dict().MemberMessage: messages = api.response_dict().MemberMessage.MemberMessageExchange if type(messages) != list: messages = [messages] for m in messages: print("%s: %s" % (m.CreationDate, m.Question.Subject[:50])) except ConnectionError as e: print e
def feedback(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid, warnings=False) api.execute('GetFeedback', {'UserID': 'tim0th3us'}) dump(api) if int(api.response_dict().FeedbackScore) > 50: print("Doing good!") else: print("Sell more, buy more..") except ConnectionError as e: print e
def run(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid) api.execute('GetCharities', {'CharityID': 3897}) dump(api) print(api.response_dict().Charity.Name) except ConnectionError as e: print e
def feedback(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, certid=opts.certid, devid=opts.devid, warnings=False) api.execute('GetFeedback', {'UserID': 'tim0th3us'}) dump(api) if int(api.response_dict().FeedbackScore) > 50: print("Doing good!") else: print("Sell more, buy more..") except ConnectionError as e: print e