示例#1
0
def main():
    infoList=getRssInfo()
    for info in infoList:
        try:
            table.InsertItemDict(ctable, info)
            print timeFormat.getTimeStamp(info['ctime']),info['title']     
        except:
            logging.error('encoding not supported:%s'%info['url'])
    return ctable,len(infoList)
示例#2
0
def main():
    infoList = getHtmlInfo()
    for info in infoList:
        try:
            table.InsertItemDict(ctable, info)
            print timeFormat.getTimeStamp(info["ctime"]), info["title"]
        except:
            logging.error("encoding not supported:%s" % info["url"])
    return ctable, len(infoList)
示例#3
0
def main():
    infoDict={}
    infoDict.update(getJsInfo())
    for url in urls:
        infoDict.update(getHtmlInfo(url))
    for info in infoDict.itervalues():
        try:
            table.InsertItemDict(ctable, info)
            print timeFormat.getTimeStamp(info['ctime']),info['title']
        except:
            logging.error('encoding not supported:%s'%info['url'])  
    return ctable,len(infoDict)
示例#4
0
def call_sync():         
    global count
    count+=1
    if count%24==0:
        merge.garbageDepos(10) 
    for web in webs:
        webdic[web].main()
        merge.mergeWeb(web)
        print 'Main thread begins to sleep at time %s' %(timeFormat.getTimeStamp(),)
        time.sleep(500)