Exemple #1
0
	def run(self):
		while( True ):
			if( self.count == 10 ):
				self.count = 0
				print( "hello!" )
				f = urllib.request.urlopen( self.url )
				feed = stockutils.formatFeed( f )
				stockutils.updateList( self.tickerList, feed )
			
			time.sleep(1)
			self.count = self.count + 1
Exemple #2
0
    def run(self):
        while (True):
            if (self.count == 10):
                self.count = 0
                print("hello!")
                f = urllib.request.urlopen(self.url)
                feed = stockutils.formatFeed(f)
                stockutils.updateList(self.tickerList, feed)

            time.sleep(1)
            self.count = self.count + 1
Exemple #3
0
def main():
	os.popen( 'tput civis', 'w' )


	tickerList = []


	params = ''
	if len( sys.argv ) > 1:
		symbols = sys.argv.remove( sys.argv[0] )
		for arg in sys.argv:
			params = params + arg + '+'
		
		params = params[:len( params ) - 1]
	else:
		params = 'GOOG+MSFT'

	url = "http://download.finance.yahoo.com/d/quotes.csv?s=" + params + "&f=sl1d1t1c1ohgv&e=.csv" 
	f = urllib.request.urlopen( url )

	feed = formatFeed( f )
	updateList( tickerList, feed )

	stockThread = stockthread.StockThread( tickerList, url )
	cu = tickercleanup.CleanUp( stockThread )
	signal.signal( signal.SIGINT, cu.clean_up )

	stockThread.start()

	os.popen( 'clear', 'w' )
	count = 0
	while True:
		rows, columns = os.popen( 'stty size', 'r' ).read().split()

		printFeed( tickerList, int( columns ) )	
		time.sleep( 0.2 );
		
		os.popen( 'clear', 'w' )
		count = count + 1
Exemple #4
0
def main():
    os.popen('tput civis', 'w')

    tickerList = []

    params = ''
    if len(sys.argv) > 1:
        symbols = sys.argv.remove(sys.argv[0])
        for arg in sys.argv:
            params = params + arg + '+'

        params = params[:len(params) - 1]
    else:
        params = 'GOOG+MSFT'

    url = "http://download.finance.yahoo.com/d/quotes.csv?s=" + params + "&f=sl1d1t1c1ohgv&e=.csv"
    f = urllib.request.urlopen(url)

    feed = formatFeed(f)
    updateList(tickerList, feed)

    stockThread = stockthread.StockThread(tickerList, url)
    cu = tickercleanup.CleanUp(stockThread)
    signal.signal(signal.SIGINT, cu.clean_up)

    stockThread.start()

    os.popen('clear', 'w')
    count = 0
    while True:
        rows, columns = os.popen('stty size', 'r').read().split()

        printFeed(tickerList, int(columns))
        time.sleep(0.2)

        os.popen('clear', 'w')
        count = count + 1