Esempio n. 1
0
def getMoreRecords(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.getTopETSVRecords(ctable, loadtime,vid,topnum)
    elif mtype == type_hot:
        records=tablemerge.getTopECESTSVRecords(ctable, click, vid, topnum)
    else:        
        records=tablemerge.getTopETSVRecords(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.getTopSTRecords(ctable, loadtime,topnum-len(vnInfos))
        elif mtype ==type_hot:
            records=tablemerge.getTopSCRecords(ctable, click, topnum-len(vnInfos))
        else:
            records=tablemerge.getTopSTRecords(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
Esempio n. 2
0
def getMoreRecords(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.getTopETSVRecords(ctable, loadtime,mvid,topnum)
    elif mtype == type_hot:
        records=tablemerge.getTopECSVRecords(ctable, click, mvid, topnum)
    else:        
        records=tablemerge.getTopETSVRecords(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.getTopSTRecords(ctable, loadtime,topnum-len(vnInfos))
        elif mtype ==type_hot:
            records=tablemerge.getTopSCRecords(ctable, click, topnum-len(vnInfos))
        else:
            records=tablemerge.getTopSTRecords(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
Esempio n. 3
0
def getMoreRecords(newsid,ctime='0',topnum=10,mtype=None,click=0):
    nInfos=[]         
    if mtype == type_hot:
        records=tablemerge.getTopECSNRecords(mergetable, click, newsid, topnum)
        nInfos+=_getInfosfromMergeRecords(records)
    else:        
        if mtype == type_new:
            records=tablemerge2.getTopETSNRecords(mergetable2, ctime,newsid,topnum)
        else:        
            records=tablemerge2.getTopETSNRecords(mergetable2, ctime,newsid,topnum,mtype)
        if records!=-1 and len(records)>0:
            nInfos+=_getInfosfromMerge2Records(records)
    if len(nInfos)<int(topnum):
        if mtype ==type_hot:
            records=tablemerge.getTopSCRecords(mergetable, click, topnum-len(nInfos))
            nInfos+=_getInfosfromMergeRecords(records)
        else:
            if mtype == type_new:     
                records=tablemerge2.getTopSTRecords(mergetable2, ctime,topnum-len(nInfos))
            else:
                records=tablemerge2.getTopSTRecords(mergetable2, ctime,topnum-len(nInfos),mtype)
            if records!=-1 and len(records)>0:
                nInfos+=_getInfosfromMerge2Records(records)
    return nInfos