def check_human_accounts():
api = get_api(key3[0], key3[1], key3[2], key3[3])
ids = []
try:
with open('..//humans.txt', 'r') as f:
for line in f:
ids.append(line.rstrip())
ids.append('\n')
os.remove('..//humans.txt')
with open('..//existing_humans_copy.txt', 'r') as f_read:
with open('..//humans.txt', 'w') as f_write:
f_write.write(''.join(ids))
for line in f_read:
user = api.get_user(line.rstrip())
print(line)
if not user.protected:
f_write.write(line)
except tweepy.TweepError:
f_read.close()
f_write.close()
评论列表
文章目录