def real(self):
    """ Real time data """
    try:
      unch = sum([covstr(self.stock[3]),covstr(self.stock[4])])/2
      re = {'name': unicode(self.stock[36].replace(' ',''), 'cp950'),
            'no': self.stock[0],
            'range': self.stock[1],
            'time': self.stock[2],
            'max': self.stock[3],
            'min': self.stock[4],
            'unch': '%.2f' % unch,
            'pp': '%.2f' % ((covstr(self.stock[8]) - unch)/unch*100),
            'open': self.stock[5],
            'h': self.stock[6],
            'l': self.stock[7],
            'c': self.stock[8],
            'value': self.stock[9],
            'pvalue': self.stock[10],
            'top5buy': [
                (self.stock[11], self.stock[12]),
                (self.stock[13], self.stock[14]),
                (self.stock[15], self.stock[16]),
                (self.stock[17], self.stock[18]),
                (self.stock[19], self.stock[20])
              ],
            'top5sell': [
                (self.stock[21], self.stock[22]),
                (self.stock[23], self.stock[24]),
                (self.stock[25], self.stock[26]),
                (self.stock[27], self.stock[28]),
                (self.stock[29], self.stock[30])
              ]
            }

      if '-' in self.stock[1]:
        re['ranges'] = False ## price down
      else:
        re['ranges'] = True ## price up

      re['crosspic'] = "http://chart.apis.google.com/chart?chf=bg,s,ffffff&chs=20x50&cht=ls&chd=t1:0,0,0|0,%s,0|0,%s,0|0,%s,0|0,%s,0&chds=%s,%s&chm=F,,1,1:4,20" % (re['h'],re['c'],re['open'],re['l'],re['l'],re['h'])
      re['top5buy'].sort()
      re['top5sell'].sort()

      return re
    except:
      return False
Real time data