Showing posts with label XMPP. Show all posts
Showing posts with label XMPP. Show all posts

Wednesday, April 2, 2008

Introducing XMPPHP

Well, I've finally done it. I finally took two evenings and wrote a replacement to Class.Jabber.PHP that I had been promising for eons. It'll work with XMPP 1.0 servers, it does TLS, has persistent connections, is event driven, etc. I'll try to get some more documentation in the coming days, but the examples included give you a pretty good idea. Check it out at svn://netflint.net/xmpphp and http://code.google.com/p/xmpphp.

This is based largely on my experience building SleekXMPP, and I'll certainly be taking some things and applying it there (threadless mode, and simpler handlers).

The only thing missing from Class.Jabber.PHP is Rosters and Registration, which I'll get to in the coming days. Please take a look and provide any feedback you might have. Also feel free to ask for my help in implementing it. I'm off to bed!

Sunday, May 27, 2007

XMPP Catchup

Quite a few things have happened in my XMPP world since my last post. My server losing it's drive caused me to accomplish next to nothing for about 2 weeks+. I still have not reached my goals with 0.1 for SleekXMPP, but I'm mostly missing just a few bug fixes and some testing. However, work on SleekBot has begun! Its a framework for people to build any type of bot, and will include a hopefully quite complete set of bot plugins. For example, remember Edgar? Edgar will be brought back to life as a Sleekbot plugin as will many other bots out there.

Sleekbot, along with SleekXMPP, now has Ad Hoc Command support.



Ad Hoc is a major feature for Sleekbot, because it will allow complete administration of the bot from an XMPP client. For example:
  • controlling admin lists
  • dynamically loading plugins
  • bot roster management
  • plugin specific configuration

  • I would love to include community contributed plugins and plugin ideas. Eventually I will want to make a Sleekbot community page. Feel free to check out and play with the code at svn://netflint.net/sleekbot

    In another news, I was accepted as an XMPP member this quarter, which I am very excited about!

    Thursday, April 5, 2007

    SleekXMPP 0.1 Plans

    See my previous post if you don't know what SleekXMPP is.

    Well, before my first release, there are a handful of things to do:

    1. I'm really not happy with how stream:features works in my lib; it's messy.
    2. Possibly add post-send handlers.
    3. Write a data-forms (XEP-0004) plugin.
    4. Stabilize the API so that it doesn't keep changing on developers.

    I should be able to take care of that this weekend so that I can start on the bot framework. The bot framework will be all about configuration. You'll be able to register chat commands, command help, command context. And then, of course, comes the events, and MUC support. After all of that, I will begin developing a bot plugin system (separate from the protocol plugins) for drop in and configurable Edgar, Thinkbot, RSS feed readers, voting bots, etc. People will be able to drop in as many plugins as they want and configure them how they want. Ideally this will be doable by non-programmers.

    Several people have asked me about licensing of SleekXMPP. To answer the question, 0.1 will likely be GPL. I'm sorry, but that's the way it is as I don't have enough time to research licenses between now and then. 0.2 will likely be a much less restrictive license, and hopefully everyone is happy with it. Current candidates are MIT, BSD, and Apache.

    In other news, I applied for XSF membership today. I'll know on the 15th (Tax Day) whether I'm in or not.

    Tuesday, April 3, 2007

    SleekXMPP

    As a self-taught, professional programmer, I have a few habits that many more formally educated peers of mine do not. One of those habits is to apply knowledge I've learned to "pet projects." Every time I learn a new technique or come up with a new idea, I tend to apply them to one of my pet projects, often requiring a full rewrite. Naturally, I see no end in sight as far as being able to improve upon my skills, however, this time I think that I've arrived somewhere.

    SleekXMPP is an XMPP library for Python. Why have I written my own when there are at least 2 others out there? Well, the first write was for a company that I worked for, and subsequent rewrites have simply been out of obsession with Jabber/XMPP. Who knows, maybe I can even use my knowledge and libraries to make money. I have purposely avoided even looking at the code of other Python XMPP implementations in order to maintain solid copyright.

    The idea is that the Jabber/XMPP community could use this to test new XEPs (XMPP Extension Protocol) very, very quickly and easily. In fact, my goal is to implement every draft XEP in existence as plugins. This ensures that I write my code in a very extensible fashion, making it easy to extend the class in any way. I am writing the core RFC's as part of the main classes, and XEPs as plugins.

    Beyond protocol testing, what am I trying to accomplish? Once I hit version 0.1 (not quite there yet), I will begin working on a bot framework. The bot framework will use the SleekXMPP lib, and in it's own right, be extensible. Bot behaviors will be configurable and extended with plugins like Thinkbot, Edgar, Mapbot, etc. Kevin Smith, of Psi fame, has promised to write a plugin for eggdrop scripts. Ideally, this framework will enable people who are not programmers to customize and run a bot. Maybe there'll be some optional GUI plugins to boot. In a related train of thought, why have I not seen more bots take advantage of data forms?

    Here is some output from what I've been working on so far:

    fritzy@peabody:~/dev/sleekxmpp$ ./example.py -d -c myconfig.xml
    INFO Loading config file: myconfig.xml
    INFO Logging in as [address-removed]@gmail.com/sleekxmpp_
    DEBUG Loaded Plugin (XEP-0030) Service Discovery
    DEBUG Loaded Plugin (XEP-0076) Malicious Stanzas
    DEBUG Loaded Plugin (XEP-0078) Non-SASL Authentication
    DEBUG Loaded Plugin (XEP-0092) Software Version
    DEBUG Connecting via client method to talk.google.com:5222
    DEBUG Starting TLS
    DEBUG Starting SASL Auth
    DEBUG Requesting resource: sleekxmpp_
    INFO Node set to: [address-removed]@gmail.com/sleekxmpp_A4E39FDC
    DEBUG Established Session


    Some of the astute amongst you may notice that I've implemented XEP-0076 as a plugin, following right behind Psi.

    Before an 0.1 release, I would like to add a well thought through plugin for XEP-0004 (Data Forms) as well as solidify some of my naming scheme for class variables and methods a little better. I should be there by this weekend. After that I will start reviewing patches and hopefully receiving contributions in the form of additional plugins. Keep in mind that a plugin does not have to be a XEP.

    Feel free to check out the code using subversion at svn://netflint.net/sleekxmpp . Any feedback would be welcome.