Exemplo n.º 1
0
def run_table_tickers():
    time = lib.now()
    tickers = get_table_tickers()
    time_ticker = lib.now()
    print 'Started Running: %s' % time_ticker
    count = 0
    pages_hit = 0
    reached = False
    try:
        for ticker in tickers:
            print ticker
            pages_hit += run_ticker(ticker)
            count += 1
            lib.sleep(count)
        db.close_db()
    finally:
        print 'Finished. Timing for getting tickers: %s, Timing for getting data: %s, Sleep count: %s, Pages Hit: %s' % (time_ticker - time, lib.now() - time_ticker, count/lib.sleep_mod, pages_hit)
Exemplo n.º 2
0
def run_nasdaq_nyse():
    nasdaq, nyse = get_nasdaq_nyse_data()
    time = lib.now()
    print 'Started Running: %s' % time
    count = 0
    print 'Nasdaq Commencing: %s' % lib.now()
    for ticker in nasdaq:
        print ticker
        run_ticker(ticker)
        count += 1
        lib.sleep(count)
    nasdaq_time = lib.now()
    print 'Nasdaq Finished, count: %s' % count
    print 'NYSE Commencing: %s' % lib.now()
    for ticker in nyse:
        print ticker
        run_ticker(ticker)
        count += 1
        lib.sleep(count)
    nyse_time = lib.now()
    print 'NYSE Finished, count: %s' % count
    db.close_db()
    print 'Finished. Timing for nasdaq: %s, Timing for nyse: %s' % (nasdaq_time - time, nyse_time - nasdaq_time)