如何检索 Google Talk 用户状态消息
我希望能够使用 Python 检索用户的 Google Talk 状态消息,但很难找到有关如何使用某些库的文档。
I'd like to be able to retrieve a users Google Talk Status Message with Python, it's really hard to find documentation on how to use some of the libraries out there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有安装 xmpp 的任何东西,但这里有一些我手头上的旧代码可能会对您有所帮助。您需要将用户名/密码更新为您自己的值以进行测试。
需要注意的事项:登录 Google Talk 的用户会在其用户 ID 上获得一个随机存在字符串:如果您试图获取其他用户的状态,那么这并不重要,但如果您想编写一些代码以便与其他用户进行通信您自己需要区分从 GMail 或 GTalk 客户端登录的用户与测试程序。因此,代码搜索用户 ID。
另外,如果您在登录后立即查看状态,您可能不会得到任何信息。代码存在延迟,因为状态需要一段时间才能变为可用。
I don't have anything to hand with xmpp installed, but here's some old code I had lying around that might help you. You'll want to update the USERNAME/PASSWORD to your own values for test purposes.
Things to note: users logged in to Google Talk get a random presence string on their userid: that doesn't matter if you are trying to get the status of some other user, but if you want to write some code so want to communicate with yourself you need to distinguish the user logged in from GMail or a GTalk client from the test program. Hence the code searches through the userids.
Also, if you read the status immediately after logging in you probably won't get anything. There's a delay in the code because it takes a little while for the status to become available.