Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
headers = self.build_req_headers()
response = requests.get(self._urls.social_home(topic, num), headers=headers)
result = response.json()
return result
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Interface with Webull. Paper trading is not the default.')
parser.add_argument('-p', '--use-paper', help='Use paper account instead.', action='store_true')
args = parser.parse_args()
if args.use_paper:
wb = paper_webull()
else:
wb = webull()
response = requests.get(self._urls.rankings(), params=params, headers=headers)
result = response.json()[0].get('data')
if extendTrading:
for data in result:
if data['id'] == 'latestActivityPc.faList':
rank = data['data']
else:
for data in result:
if data['id'] == 'latestActivityPc.5minutes':
rank = data['data']
return rank
''' Paper support '''
class paper_webull(webull):
def __init__(self):
super().__init__()
def get_account(self):
''' Get important details of paper account '''
headers = self.build_req_headers()
response = requests.get(self._urls.paper_account(self._account_id), headers=headers)
return response.json()
def get_account_id(self):
''' Get paper account id: call this before paper account actions'''
headers = self.build_req_headers()
response = requests.get(self._urls.paper_account_id(), headers=headers)
result = response.json()
id = result[0]['id']