Exemplo n.º 1
0
def get_data():
    markit = Markit()
    try:
        name = (markit.get_quote_msft())["Name"]
    except:
        pass
    try:
        last_price = (markit.get_quote_msft())["LastPrice"]
    except:
        pass
    try:
        timestamp = (markit.get_quote_msft())["Timestamp"]
    except:
        pass
    try:
        name1 = (markit.get_quote_goog())["Name"]
    except:
        pass
    try:
        last_price1 = (markit.get_quote_goog())["LastPrice"]
    except:
        pass
    try:
        timestamp1 = (markit.get_quote_goog())["Timestamp"]
    except:
        pass
    try:
        ORM.update_goog(name1, last_price1, timestamp1)
    except:
        pass
    try:
        ORM.update_msft(name, last_price, timestamp)
    except:
        pass
    sleep(5)
    get_data()