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

时间:2022-12-29 15:47:47

I am interested in making a Google Talk client using Python and would like to use the Twisted libraries Words module. I have looked at the examples, but they don't work with the current implementation of Google Talk.

我有兴趣使用Python制作Google Talk客户端,并希望使用Twisted libraries Words模块。我查看了这些示例,但它们不适用于当前的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. 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.

作为一项简单的任务,我想创建一个客户端/机器人,跟踪我的各种Google Talk帐户的在线时间,以便我可以获得总数。我想我可以在每个帐户中与机器人交朋友,然后使用XMPP状态信息来跟踪我可以聚合的时间。

Thanks.

谢谢。

4 个解决方案

#1


14  

wokkel is the future of twisted words. metajack wrote a really nice blog post on getting started.

wokkel是扭曲词语的未来。 metajack写了一篇关于入门的非常好的博客文章。

If you want a nice, functional sample project to start with, check out my whatsup bot.

如果你想要一个很好的,功能齐全的示例项目,请查看我的whatsup bot。

#2


7  

I have written a simple Jabber bot (and thus Google talk bot) using the xmpppy library, which works well. The examples on xmpppy should get you started (specifically bot.py)

我使用xmpppy库编写了一个简单的Jabber bot(以及Google talk bot),效果很好。 xmpppy上的例子应该让你入门(特别是bot.py)

As for something actually implemented in twisted.Words:

至于在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文件似乎是一个很好的起点 - 看起来很简单。

#3


2  

I was looking building an XMPP client in python a while ago. 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.

我刚才想在python中构建一个XMPP客户端。我还没有开始研究我正在寻找它的项目。我没有看到任何使用过扭曲但是我发现的几个XMPP库。

I also found a python program, under the GPL, that acts multi-point conference system using XMPP.

我还在GPL下发现了一个使用XMPP进行多点会议系统的python程序。

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

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

#4


-2  

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; XMPP is not that complicated and you are bound to learn something.

我建议使用原始XML; XMPP并不复杂,你必须学习一些东西。

#1


14  

wokkel is the future of twisted words. metajack wrote a really nice blog post on getting started.

wokkel是扭曲词语的未来。 metajack写了一篇关于入门的非常好的博客文章。

If you want a nice, functional sample project to start with, check out my whatsup bot.

如果你想要一个很好的,功能齐全的示例项目,请查看我的whatsup bot。

#2


7  

I have written a simple Jabber bot (and thus Google talk bot) using the xmpppy library, which works well. The examples on xmpppy should get you started (specifically bot.py)

我使用xmpppy库编写了一个简单的Jabber bot(以及Google talk bot),效果很好。 xmpppy上的例子应该让你入门(特别是bot.py)

As for something actually implemented in twisted.Words:

至于在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文件似乎是一个很好的起点 - 看起来很简单。

#3


2  

I was looking building an XMPP client in python a while ago. 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.

我刚才想在python中构建一个XMPP客户端。我还没有开始研究我正在寻找它的项目。我没有看到任何使用过扭曲但是我发现的几个XMPP库。

I also found a python program, under the GPL, that acts multi-point conference system using XMPP.

我还在GPL下发现了一个使用XMPP进行多点会议系统的python程序。

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

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

#4


-2  

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; XMPP is not that complicated and you are bound to learn something.

我建议使用原始XML; XMPP并不复杂,你必须学习一些东西。