twitter_account_checker.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:anomalous-vertices-detection 作者: Kagandi 项目源码 文件源码
def batch_url_extractor(input_path, output_path):
    last_id = False
    if os.path.isfile(output_path):
        last_id = get_last_written_id(output_path)
    f = read_file(input_path)
    for line_count, link in enumerate(f):
        user_id = link[0].strip()
        if last_id == user_id:
            last_id = False
            break
    if last_id is False:
        processes = Parallel(n_jobs=4)(
            delayed(get_twitter_account_state)(user_id) for user_id in f)
        processes = [x for x in processes if x is not None]
        # if line_count % 10000 == 0:
        append_list_to_csv(output_path, processes)
        # write_to_file(output_path, two_dimensional_list_to_string(result))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号