Exemple #1
0
def create():
    print(
        'Please proivide the name of the site or app you want to generate a password for'
    )
    app_name = input()
    print('Please provide a simple password for this site: ')
    plaintext = input()
    passw = password(plaintext, app_name, 12)
    pyperclip.copy(passw)
    # pyperclip.run("pbcopy", universal_newlines=True, input=passw)
    print('-' * 30)
    print('')
    print('Your password has now been created and copied to your clipboard')
    print('')
    print('-' * 30)
    print('Please provide a user email for this app or site')
    email = input()
    print('Please provide a username for this app or site (if applicable)')
    user = input()
    if user == None:
        user = ''
    print(
        'Please paste the url to the site that you are creating the password for'
    )
    url = input()
    store_data(app_name, passw, user, email, url)
Exemple #2
0
def add():
    print('Provide name of site or app')
    app_name = input().strip()
    print('Provide your username for site or app (if any)')
    user = input()
    print('Provide your email address for site or app')
    email = input()
    print('Provide your password')
    passw = input()
    print('Provide URL for the site')
    url = input()
    print("\n" + 'Your information has been stored succesfully!' + "\n")
    store_data(app_name, passw, user, email, url)
Exemple #3
0
    def run(self):
        while True:
            try:
                tickers = self.client.get_all_tickers()
                server_time = self.client.get_server_time()['serverTime']

                for t in tickers:
                    if t['symbol'] in ["ETHUSDT", "BTCUSDT"]:

                        models.store_data(int(server_time), float(t['price']),
                                          t['symbol'])
                time.sleep(1)
            except Exception as e:
                print(e)
Exemple #4
0
    def run(self):
        while True:
            try:
                t = self.client.get_server_time()['serverTime']
                for s in self.symbols:

                    data = self.client.get_ticker(symbol=s)
                    models.store_data(t, s, data['lastPrice'], data['lastQty'],
                                      data['askPrice'], data['askQty'],
                                      data['bidPrice'], data['bidQty'])
                    time.sleep(1)

            except Exception as e:
                print("Failed at ", datetime.datetime.now())
                print(e)
Exemple #5
0
class Scraper:
    def __init__(self):
        self.api_key = '4q1Tmp8ATgJ49AqubnH7NU6nm1P23k3QDibHmVAfXpO0x1CBb5TMYMb0gsPLyH6Y'
        self.api_secret = "CxpRkkyab0S2hxAS9uiQiE6quLf8xZQFfPBK6caIsTLHwfUvQFrOmiFb5AzqyTpn"
        self.client = Client(self.api_key, self.api_secret)
        self.symbols = ["BTCUSDT", "ETHUSDT"]


    def run(self):
        while True:
            for 
            try:

                btc = self.client.get_ticker(symbol="BTCUSDT")
                eth = self.client.get_ticker(symbol='ETHUSDT')

                server_time = self.client.get_server_time()['serverTime']

                for t in tickers:
                    if t['symbol'] in ["ETHUSDT", "BTCUSDT"]:

                        models.store_data(int(server_time), float(t['price']), t['symbol'])
                time.sleep(1)
            except Exception as e:
                print(e)