简体   繁体   English

如何使用Twisted Words Python库创建简单的Google Talk客户端?

[英]How do you create a simple Google Talk Client using the Twisted Words Python library?

I am interested in making a Google Talk client using Python and would like to use the Twisted libraries Words module. 我有兴趣使用Python制作Google Talk客户端,并希望使用Twisted library Words模块。 I have looked at the examples, but they don't work with the current implementation of Google Talk. 我看过这些示例,但它们不适用于当前的Google Talk实现。

Has anybody had any luck with this? 有人有运气吗? Would you mind documenting a brief tutorial? 您介意编写简短的教程吗?

As a simple task, I'd like to create a client/bot that tracks the Online time of my various Google Talk accounts so that I can get an aggregate number. 作为一项简单的任务,我想创建一个客户端/机器人来跟踪我的各种Google Talk帐户的在线时间,以便获得一个汇总数字。 I figure I could friend the bot in each account and then use the XMPP presence information to keep track of the times that I can then aggregate. 我认为我可以在每个帐户中让该漫游器成为朋友,然后使用XMPP存在信息来跟踪可以汇总的时间。

Thanks. 谢谢。

wokkel is the future of twisted words. wokkel是未来的双刃剑。 metajack wrote a really nice blog post on getting started. metajack在入门方面写了一篇非常不错的博客文章

If you want a nice, functional sample project to start with, check out my whatsup bot. 如果您想要一个不错的,功能齐全的示例项目,请查看我的whatsup机器人。

I have written a simple Jabber bot (and thus Google talk bot) using the xmpppy library, which works well. 我已经使用xmpppy库编写了一个简单的Jabber机器人(因此也称为Google Talk机器人),效果很好。 The examples on xmpppy should get you started (specifically bot.py ) xmpppy上的示例应该可以帮助您入门(特别是bot.py

As for something actually implemented in twisted.Words: 至于实际上在扭曲中实现的东西。

Here is a simple tutorial on creating a bot that prints every received message to the local terminal (and a version that replies with the revere of the received message). 是一个有关创建自动程序的简单教程,该自动程序将收到的所有消息打印到本地终端(以及响应收到的消息的版本)。 To track the online time of various accounts, you would add a callback for "presences" (going online/offline/away etc are "presence changes", in Jabber terminology) 要跟踪各种帐户的在线时间,您可以添加“状态”的回调(使用Jabber术语,“在线/离线/离开等都是”状态更改”)

For a more complete system, pownce-jabber-bot uses twisted.words and wokkel for the jabber interface. 对于更完整的系统, pownce-jabber-bot使用twisted.words和wokkel作为jabber界面。

The powncebot/__init__.py file seems like a good place to start - it's seems pretty simple. powncebot / __ init__.py文件似乎是一个很好的起点-看起来很简单。

I was looking building an XMPP client in python a while ago. 不久前,我正在寻找用python构建XMPP客户端。 I haven't gotten around to working on the project I was looking at it for. 我还没有开始从事我一直在寻找的项目。 I didn't see anything that used twisted but are a couple XMPP libraries I found. 我没有看到使用过扭曲的任何东西,但是发现了几个XMPP库。

I also found a python program, under the GPL, that acts multi-point conference system using XMPP. 我还在GPL下找到了一个python程序,该程序使用XMPP充当多点会议系统。

http://coders.meta.net.nz/~perry/jabber/confbot.php http://coders.meta.net.nz/~perry/jabber/confbot.php

As the Twisted libs seem to be out of date, you have two choices: Implement your own XMPP-handler or look for another library. 由于Twisted库似乎已过时,因此您有两种选择:实现自己的XMPP处理程序或寻找另一个库。

I would suggest working with the raw XML; 我建议使用原始XML。 XMPP is not that complicated and you are bound to learn something. XMPP并不那么复杂,您一定会学到一些东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Google Talk中使用wokkel :(错误twisted.words.protocols.jabber.sasl.SASLNoAcceptableMechanism) - How to use wokkel with google talk: (error twisted.words.protocols.jabber.sasl.SASLNoAcceptableMechanism) 如何使用 google-api-client 创建实例? - How do you create an instance using google-api-client? python扭曲简单的服务器客户端 - python twisted simple server client 如何使用 python 客户端库处理 bigquery 中简单选择的大型查询结果? - How do you handle large query results for a simple select in bigquery with the python client library? 如何在Python中创建Socket.io客户端以与Sails服务器对话 - How to create Socket.io client in Python to talk to a Sails server 您如何使用Python与自定义DBUS对象对话? - How do you talk to custom DBUS object with Python? 您如何通过 Python(而不是通过 Twisted)运行 Twisted 应用程序? - How do you you run a Twisted application via Python (instead of via Twisted)? Twisted Python如何使用自定义trustRoot创建twisted.web.client.BrowserLikePolicyForHTTPS? - Twisted Python How To Create a twisted.web.client.BrowserLikePolicyForHTTPS with a custom trustRoot? 如何使用python中的计数器库计算唯一单词? - How do I count unique words using counter library in python? 如何使用smpp.twisted python库发送长消息 - How to send long message using smpp.twisted python library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM