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))
twitter_account_checker.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录