使用 Twitter API 的 Streaming 功能的 401 错误(通过 Tweepy) [英] 401 error using the Streaming features of Twitter API (through Tweepy)

查看:29
本文介绍了使用 Twitter API 的 Streaming 功能的 401 错误(通过 Tweepy)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它利用了 Twitter API 的许多功能.我已经在一个 Windows 7 系统上测试了该应用程序,所有功能都运行良好.

I've got an application which takes advantage of a number of features of the Twitter API. I've tested the application on one Windows 7 system, and all features worked well.

在第二个 Windows 7 系统上测试应用程序,似乎除了公共流和用户流功能之外的一切都在工作(即应用程序设法进行身份验证,可以关注/取消关注用户等).在此系统上,Stream 功能会产生 401 错误.据我了解,401 可能表示授权错误(在这种情况下不会发生,因为可以使用非流媒体功能),或者 Twitter 服务器和客户端系统之间的时间配置差异.

Testing the application on a second Windows 7 system, it seems that everything but the Public Stream and User Stream features is working (i.e. the app managed to authenticate, can follow/unfollow users, etc). On this system, the Stream features produce a 401 error. As I understand it, 401 could indicate an authorization error (which isn't happening in this case, since non-streaming features are available), or a difference in time configuration between Twitter's servers, and the client system.

我希望我的应用程序的流媒体功能可以跨平台使用(Windows、Mac、Unix),我不能指望最终用户修改他们系统的时钟配置.任何人都可以在由时间配置问题引起的情况下为 401 错误问题推荐一个与系统无关的基于 Tweepy/python 的解决方案吗?谢谢.

I'd like the streaming features of my app to be available cross platform (Windows, Mac, Unix), and I can't expect end-users to tinker with their system's clock configurations. Can anyone recommend a system-agnostic Tweepy/python-based solution to the 401 error issue under the condition that it's caused by a time-configuration problem? Thanks.

在 Stream 功能不工作的系统上,在手动修改系统时钟后没有成功,我与 time.windows.com 同步.这对显示的时间没有任何明显的影响(我没有看到秒数),但它解决了问题(即 Twitter 用户和公共流功能变得可用).问题仍然存在 - 如何防止在最终用户的系统上出现这样的错误?提醒用户调整时钟对我来说是不现实的.

On the system on which the Stream features were not working, after having manually tinkered with the system clock, with no success, I synchronized with time.windows.com. This didn't have any discernible effect on the time that was showing (I didn't have a view of the seconds), but it resolved the problem (i.e. the Twitter User and Public Stream features became available). The question remains - how does one prevent such an error from arising on end users' systems? It's unrealistic for me to warn users to adjust their clocks.

推荐答案

您的系统时钟可能有 5 分钟以上的偏差.

Your system clock is probably more than 5 minutes off.

这篇关于使用 Twitter API 的 Streaming 功能的 401 错误(通过 Tweepy)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆