我刚开始使用tweepy
库连接twitter的流API。我遇到了on_status()
类的on_data()
和StreamListener
方法。有什么不同?总菜鸟在这里!
答案 0 :(得分:7)
on_data()
处理:
然而,on_status()
只处理状态。
来源:https://github.com/tweepy/tweepy/blob/78d2883a922fa5232e8cdfab0c272c24b8ce37c4/tweepy/streaming.py
答案 1 :(得分:4)
If you're only concerned with tweets, use on_status()
. This will give you what you needed without the added information and doing so will not hinder your limit.
If you want detailed information use on_data()
. --That's rarely the case unless you're doing heavy analysis.