2022-04-12 07:50:24 +00:00
|
|
|
__author__ = "Florian Kaiser"
|
|
|
|
__copyright__ = "Copyright 2022, Project Aktienbot"
|
|
|
|
__credits__ = ["Florian Kaiser", "Florian Kellermann", "Linus Eickhof", "Kevin Pauer"]
|
|
|
|
__license__ = "GPL 3.0"
|
|
|
|
__version__ = "1.0.0"
|
|
|
|
|
2022-04-05 13:08:57 +00:00
|
|
|
import os
|
2022-04-05 10:38:06 +00:00
|
|
|
import random
|
|
|
|
|
|
|
|
import faker
|
|
|
|
import requests
|
|
|
|
|
|
|
|
username = ''
|
|
|
|
password = ''
|
|
|
|
|
|
|
|
shares = ["TWTR", "GOOG", "AAPL", "MSFT", "AMZN", "FB", "NFLX", "TSLA", "BABA", "BA", "BAC", "C", "CAT", "CSCO", "CVX", "DIS", "DOW", "DUK", "GE", "HD", "IBM" "INTC", "JNJ", "JPM", "KO",
|
|
|
|
"MCD", "MMM", "MRK", "NKE", "PFE", "PG", "T", "UNH", "UTX", "V", "VZ", "WMT", "XOM", "YHOO", "ZTS"]
|
|
|
|
|
|
|
|
fake = faker.Faker()
|
|
|
|
|
2022-04-05 13:08:57 +00:00
|
|
|
token = requests.post(os.getenv("API_URL") + '/user/login', json={"email": username, "password": password}).json()['data']['token']
|
2022-04-05 10:38:06 +00:00
|
|
|
|
|
|
|
for i in range(1, 1000):
|
|
|
|
payload = {
|
|
|
|
"count": random.randint(1, 100),
|
|
|
|
"price": random.random() * 100,
|
|
|
|
"symbol": shares[random.randint(0, len(shares) - 1)],
|
|
|
|
"time": fake.date_time().isoformat() + ".000Z"
|
|
|
|
}
|
|
|
|
|
2022-04-05 13:08:57 +00:00
|
|
|
response = requests.post(os.getenv("API_URL") + '/transaction', json=payload, headers={'Authorization': 'Bearer ' + token})
|