有没有什么方法可以计算特定 Twitter ID 的提及次数而无需身份验证
php 有什么方法可以找出特定 Twitter id 的提及总数。假设我的 Twitter Id 是 123456789 或我的屏幕名称是 "ABCD" 。我想计算到目前为止我(即@andrew)提及的总数。我想在没有用户身份验证的情况下执行此操作。
谢谢
Is there any way in php to find out the total number of mentions made by a particular twitter id.Suppose my Twitter Id is 123456789 or my screen name is "ABCD" . I want to calculate total number of mentions made by me(i.e. @andrew) so far.I want to do this without user authentication.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很好,两种情况。如果要了解某个用户提及其他用户的频率,您可以使用 user_timeline 资源而无需身份验证。您可以一次获取用户的 200 条推文,然后使用since_id 参数继续获取较旧的推文。对于每条推文,您都可以检查它是否包含提及。
至于其他情况,我就不太清楚了。您可以使用搜索 API,通过搜索字符串“to:username”搜索 @replies,或者使用搜索字符串“username”来生成该用户的推文,以及 @replies 和 @mentions。 Twitter 搜索只提供最近几天的结果,所以我怀疑这对你有帮助。
祝你好运!
Very well, both cases. In the case of finding out how often a certain user mentions others you could use the user_timeline resource without needing authentication. You could fetch 200 tweets by a user a time and then make use of the since_id parameter to keep fetching older tweets. For every tweet you can then check if it contains a mentions.
As for the other case, I'm not sure. You could use the search API with a search string of "to:username" for @replies or a search string of "username" which would yield tweets by that user, as well as @replies and @mentions. Twitter search only gives results for the last couple of days though so I doubt that this would help you.
Good luck!