Exemple #1
0
def catch_all_entry_urls():
    storeservice = MysqlService()
    mongodbutil = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port,
                              AppConfig.mongodb_collection)
    sinanewshistory = SinanewsService(mongodbutil)
    ret_arr = storeservice.find_all_stockcodes_exclude_nodata()
    thread_name = 'catch all stock entry url'
    once_global_task(thread_name, ret_arr, storeservice, sinanewshistory)
storeservice = MysqlService()
mongodbutil = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection)
mongodbutil_futunnlive = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_futunnlive)
mongodbutil_calendar = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_calendar)
mongodbutil_cash = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_cash)
mongodbutil_balancesheet = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_balancesheet)
mongodbutil_income = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_income)
mongodbutil_companyinfo = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_companyinfo)
mongodbutil_dividend = MongodbUtil(AppConfig.mongodb_ip, AppConfig.mongodb_port, AppConfig.mongodb_collection_dividend)


futunews = FutunnService(mongodbutil,mongodbutil_futunnlive,mongodbutil_calendar,
                         mongodbutil_cash,mongodbutil_balancesheet,mongodbutil_income,
                         mongodbutil_companyinfo,mongodbutil_dividend)
ret_arr = storeservice.find_all_stockcodes_exclude_nodata()


def catch_lastest_news():
    ret_arr = storeservice.find_all_stockcodes_exclude_nodata()
    thread_name = 'catch lastest news'
    once_appender_task(thread_name,ret_arr, storeservice,futunews)

def catch_futunn_news_byapi():
    ret_arr = storeservice.find_all_stockcodes_exclude_nodata()
    thread_name = 'catch all news'
    once_appender_byapi_task(thread_name, ret_arr, storeservice, futunews)

def catch_futu_individuals():
    ret_arr = storeservice.find_all_stockcodes_exclude_nodata()
    thread_name = 'catch all individuals'