Example #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)
Example #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)
Example #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)
Example #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)