How do you create a simple Google Talk Client using the Twisted Words Python library?
Asked Answered
H

4

17

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.

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.

Thanks.

Hispanicize answered 22/10, 2008 at 19:48 Comment(1)
I'm also interested in this... does anyone know?Hindoo
L
14

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

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

Levinson answered 29/11, 2008 at 5:42 Comment(0)
H
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)

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)

For a more complete system, pownce-jabber-bot uses twisted.words and wokkel for the jabber interface.

The powncebot/__init__.py file seems like a good place to start - it's seems pretty simple.

Hulbig answered 23/10, 2008 at 8:32 Comment(0)
T
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.

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

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

Treacle answered 23/10, 2008 at 8:24 Comment(0)
B
-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.

I would suggest working with the raw XML; XMPP is not that complicated and you are bound to learn something.

Burkes answered 23/10, 2008 at 7:44 Comment(1)
I would strongly recommend against dealing with raw XML (for an actual bot.. as an experiment, sure) - you are just reinventing any XMPP library. I imagine all the libraries should have a verbose option somewhere that will show the raw XML..Hulbig

© 2022 - 2024 — McMap. All rights reserved.