예제 #1
0
파일: google.py 프로젝트: RedRise/quoter
    def get_quotes( self, *args ):

        syms = qutils.extract_symbols( args )
        self.logger.info("symbols read: %s" % ",".join( syms ) )
        data = self._get_quotes_raw( syms )
        tk = [ (d['e']+':'+d['t']).upper() for d in data] + \
             [ d['t'].upper() for d in data ]

        res = {}
        for s in syms:
            sU = s.upper()
            if sU in tk:
                res[s] = data[ tk.index(sU) % len(data) ]

        return( res )
예제 #2
0
파일: yahoo.py 프로젝트: RedRise/quoter
    def get_quotes( self, *args ):

        syms = qutils.extract_symbols( args )
        self.logger.info("symbols read : %s" % ",".join( syms ) )

        data = self._get_select_raw( "yahoo.finance.quotes", syms )

        tk   = [ d['symbol'].upper() for d in data ]
        res = {}
        for s in syms:
            sU = s.upper()
            if sU in tk:
                res[s] = data[ tk.index(sU) ]

        return(res)