Exemplo n.º 1
0
def getRefreshRecords(web,vid,loadtime='0',topnum=10,mtype=None,click=0):
    vnInfos=[] 
    if mtype not in merge_cn:
        return vnInfos
    if mtype == type_new:        
        records=tablemerge.getBottomETBVRecords(ctable, loadtime,vid,topnum)
    elif mtype == type_hot:
#         records=tablemerge.getBottomECBVRecords(ctable, click, vid, topnum)
        records=[]
    else:        
        records=tablemerge.getBottomETBVRecords(ctable, loadtime,vid,topnum,mtype)
    if records!=-1 and len(records)>0:
        for item in records:
        #0id,1vid,2title,3url,4thumb,5summary,6keywords,7newsid,8vtype,9source,10related,
        #11loadtime,12duration,13web,14mvid,15mtype,16click
        #vid,title,url,thumb,brief,source,loadtime,duration,web,mtype,click
            vnInfos.append(NewsInfo(item[1],item[2],item[3],item[4],item[5],item[9],item[11],
                                    item[12],item[13],item[15],item[16]))
    if len(vnInfos)<int(topnum):
        if mtype == type_new:
            records=tablemerge.getBottomBTRecords(ctable, loadtime,topnum-len(vnInfos))
        elif mtype == type_hot:
            records=[]
        else:            
            records=tablemerge.getBottomBTRecords(ctable, loadtime,topnum-len(vnInfos),mtype)
        if records!=-1 and len(records)>0:
            for item in records:
                vnInfos.append(NewsInfo(item[1],item[2],item[3],item[4],item[5],item[9],item[11],
                                    item[12],item[13],item[15],item[16]))
    return vnInfos
Exemplo n.º 2
0
def getRefreshRecords(web,mvid,loadtime='0',topnum=10,mtype=None,click=0):
    vnInfos=[] 
    if mtype not in merge_cn:
        return vnInfos
    if mtype == type_new:        
        records=tablemerge.getBottomETBVRecords(ctable, loadtime,mvid,topnum)
    elif mtype == type_hot:
#         records=tablemerge.getBottomECBVRecords(ctable, click, mvid, topnum)
        records=[]
    else:        
        records=tablemerge.getBottomETBVRecords(ctable, loadtime,mvid,topnum,mtype)
    if records!=-1 and len(records)>0:
        for item in records:
        #0id,1webid,2vid,3title,4url,5thumb,6summary,7keywords,8newsid,9vtype,10source,
        #11related,12loadtime,13duration,14web,15mvid,16mtype,17click
        #2vid,3title,4url,5thumb,6brief,10source,12loadtime,13duration,14web,15mvid,16mtype,17click
            vnInfos.append(NewsInfo(item[2],item[3],item[4],item[5],item[6],item[10],
                                    item[12],item[13],item[14],item[15],item[16],item[17]))
    if len(vnInfos)<int(topnum):
        if mtype == type_new:
            records=tablemerge.getBottomBTRecords(ctable, loadtime,topnum-len(vnInfos))
        elif mtype == type_hot:
            records=[]
        else:            
            records=tablemerge.getBottomBTRecords(ctable, loadtime,topnum-len(vnInfos),mtype)
        if records!=-1 and len(records)>0:
            for item in records:
                vnInfos.append(NewsInfo(item[2],item[3],item[4],item[5],item[6],item[10],
                                    item[12],item[13],item[14],item[15],item[16],item[17]))
    return vnInfos