Email subscription to comments

Share

Hey all. Yesterday I finally got around to implementing email subscriptions to comments on posts in my custom comment module code for Blosxom. I run a custom comment module because of the static generation mode I use for the site, which helps reduce load on Andrew‘s server.

Email subscription to comments on a post that you have commented on is the default, but it is easy for the user to turn it off. If you post and opt for email, you’ll also get an email when your own post survives moderation, which might be useful for some people.

It will be interesting to see if willingness to be emailed a comment is an effective spam signal or not — so far with a sample of six spam comments, it seems to be evenly split between the two options, which is interesting because it means some spam bots are smart enough to turn the check box off. Or are they using a POST without using my form at all?

(That makes me wonder if moving the URL for the submission CGI might reduce spam…)

If there is any interest in a public release of my uber crap perl code let me know, and I might try and find the time to clean it up.

Share

Book status

Share

I was thinking about the delivery status of the MythTV book as I was going off to sleep last night, and it occurred to me that the book is pretty much done. It’s a good feeling.

Stewart needs to finish poking a chapter on cut lists and so forth, with should be minimal effort, then he needs to work on chapters on MythWeb and VoIP (the VoIP one is half done). I need to write an updated introduction (the contents of the book have deviated from plan, although that always happens) as well as a short conclusion chapter, and help Stewart write a chapter about running the latest and greatest version of the code (and how to interact with the development community).

Then we’re done for the writing. That description can be summarised as “Stewart and I appear to both be about one and a half chapters away from finishing authoring”.

We of course still need to get through technical review, editorial review, replying to things those reviewers need changed, copy editing, page layout, and standing on one leg. We’re getting towards the end of the project though.

When I think about it that way, I guess I read the ImageMagick book around four or five times.

You can pre order a copy of the MythTV book from Amazon for $20 US.

Share

Please report to the municipal hall of justice

Share

Catherine rang me while I was at work yesterday to let me know that I had a letter from the courthouse in Santa Clara country demanding (it doesn’t make it sound all that optional) that I attend at the “Municipal Hall of Justice” for jury duty. Yes, they really called it that. Yes, I thought it sounded like something from a bad 1980’s film too.

So, I apparently can get out of the jury duty by proving to them that I am not a citizen. In fact, it’s much more onerous to show that you’re not a citizen than it is for many of the other escape clauses. They want a copy of my passport for example.

The letter also doesn’t make it particularly clear if being a non-citizen excludes me from jury duty or not. Oh, and the only contact details on the letter are a web site, and a 24 hour recorded message line. I don’t know if I would serve or not if given the option — I probably would.

So, am I able to serve? Should I? Will the Demolition Man be at the municipal hall of justice? What about Judge Dredd?

Share

Getting Google Talk working with PyXMPP

Share

Jacek Konieczny has written the wholly fantabulous PyXMPP, which implements Jabber clients and servers in Python. Now, Google Talk is a Jabber server, but it needs TLS support before it works. The code is all there, but the echobot example in the download (look in the examples directory) doesn’t show you how. It’s not that hard though — here’s the patch I needed to make it work:

    --- echobot.py  2005-12-26 07:25:55.000000000 -0800
    +++ echobot2.py 2006-10-25 04:25:02.000000000 -0700
    @@ -13,6 +13,7 @@
    
     from pyxmpp.all import JID,Iq,Presence,Message,StreamError
     from pyxmpp.jabber.client import JabberClient
    +from pyxmpp import streamtls
    
     class Client(JabberClient):
         """Simple bot (client) example. Uses `pyxmpp.jabber.client.JabberClient`
    @@ -28,8 +29,12 @@
    
             # setup client with provided connection information
             # and identity data
    +
    +        tls = streamtls.TLSSettings(require=True, verify_peer=False)
    +        auth = ['sasl:PLAIN']
             JabberClient.__init__(self, jid, password,
    -                disco_name="PyXMPP example: echo bot", disco_type="bot")
    +                disco_name="PyXMPP example: echo bot", disco_type="bot",
    +                tls_settings=tls, auth_methods=auth)
    
             # register features to be announced via Service Discovery
             self.disco_info.add_feature("jabber:iq:version")
    

That makes the __init__ method for the client:

    def __init__(self, jid, password):
    
        # if bare JID is provided add a resource -- it is required
        if not jid.resource:
            jid=JID(jid.node, jid.domain, "Echobot")
    
        # setup client with provided connection information
        # and identity data
    
        tls = streamtls.TLSSettings(require=True, verify_peer=False)
        auth = ['sasl:PLAIN']
        JabberClient.__init__(self, jid, password,
                disco_name="PyXMPP example: echo bot", disco_type="bot",
                tls_settings=tls, auth_methods=auth)
    
        # register features to be announced via Service Discovery
        self.disco_info.add_feature("jabber:iq:version")
    

Now the client works with a gtalk login:

    $ ./echobot2.py username@gmail.com supersecretthingie
    creating client...
    connecting...
    *** State changed: resolving srv (u'gmail.com', 'xmpp-client') ***
    *** State changed: resolving 'talk.l.google.com.' ***
    *** State changed: connecting ('72.14.253.125', 5222) ***
    *** State changed: connected ('72.14.253.125', 5222) ***
    looping...
    *** State changed: tls connecting  ***
    *** State changed: tls connected  ***
    *** State changed: fully connected  ***
    *** State changed: authenticated  ***
    *** State changed: binding u'Echobot' ***
    *** State changed: authorized  ***
    mikalstill@gmail.com/Gaim6734F991 has become available
    mikalstill@gmail.com/GaimD2ECF56B has become available(away): I'm not at my
    desk at work at the moment. This is probably because I'm at a meeting or
    racing electric scooters. If you IM me I will see the message when I get back.
    My roster:
    mikalstill@gmail.com "" subscription=both groups=
    Message from mikalstill@gmail.com/Gaim6734F991 received. Body: "Hello there". Type: "chat".
    disconnecting...
    exiting...
    $
    

Too easy.

Update: mbot is a Google Talk bot engine built on top of this.

Share