示例#1
0
def getSearchedRelated(web,mvid,loadtime='0',topnum=10,mtype=None,click=0):
    vnInfos=[] 
    rows=tablemerge.getTitleByMVid(ctable,mvid)
    if rows==-1 or len(rows)<1:
        return vnInfos
    title=rows[0][0]      
#     print title  
    records=search.searchWithLimit(title,limit=topnum+1)
    if records!=None and len(records)>0:
        for item in records:
            if item['mvid']==mvid:
                continue
            #2vid,3title,4url,5thumb,6brief,10source,12loadtime,13duration,14web,15mvid,16mtype,17click
            vnInfos.append(NewsInfo(item['vid'],item['title'],item['url'],item['thumb'],item['summary'],item['source'],
                                    item['loadtime'],item['duration'],item['web'],item['mvid'],item['mtype'],item['click']))
    if len(vnInfos)>topnum:
        return vnInfos[0:topnum]
    return vnInfos
示例#2
0
def getSearchedRelated(web,vid,loadtime='0',topnum=10,mtype=None,click=0):
    vnInfos=[] 
    rows=tablemerge.getRecordsByWebVid(ctable,web,vid)
    if rows==-1 or len(rows)<1:
        return vnInfos
    title=rows[0][0]      
    print title  
    records=search.searchWithLimit(title,limit=topnum+1)
    if records!=None and len(records)>0:
        for item in records:
            if item['vid']==vid and item['web']==web:
                continue
            #vid,title,url,thumb,brief,source,loadtime,duration,web,mtype,click
            vnInfos.append(NewsInfo(item['vid'],item['title'],item['url'],item['thumb'],item['summary'],
                                    item['source'],item['loadtime'],item['duration'],item['web'],
                                    item['mtype'],item['click']))
    if len(vnInfos)>topnum:
        return vnInfos[0:topnum]
    return vnInfos
示例#3
0
def getSearchedRelated(newsid,ctime='0',topnum=10,mtype=None,click=0):
    nInfos=[] 
    rows=tablemerge2.getRecordsByNewsid(mergetable2,newsid)
    if rows==-1 or len(rows)<1:
        return nInfos
    title=rows[0][3]      
    print title  
    records=search.searchWithLimit(title,limit=topnum+1)
    if records!=None and len(records)>0:
        for item in records:
            if item['newsid']==newsid:
                continue
            #4newsid,3title,2url,5thumb,6brief,9source,8ctime,10author,11description,12mtype,13click/related
            nInfos.append(NewsInfo(item['newsid'],item['title'],item['url'],item['thumb'],item['summary'],
                                    item['source'],item['ctime'],item['author'],item['description'],item['mtype'],
                                    [],0))
    if len(nInfos)>topnum:
        return nInfos[0:topnum]
    return nInfos