Content here is by:
Michael Still
mikal@stillhq.com

All my Open Source projects
Extracted view of CVS
Home
Site map

See recent comments. RSS feed of all comments.

ImageMagick book

MythTV book








Sun, 19 Nov 2006



Getting Google Talk working with PyXMPP

    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.

    Tags for this post: google(S) gtalk(S)

posted at: 16:54 | path: /google/gtalk | permanent link to this entry


Wed, 06 Sep 2006



Looking for Women studying computing in Australia

    I was in an unrelated meeting at work today, and it came up that the first annual Anti Borg scholarship is closing it's application window in a few days. I thought it was worth mentioning here, in case there are people who are interested in applying. The basic deal is:

    Dr. Anita Borg (1949 - 2003) devoted her adult life to revolutionizing the way we think about technology and dismantling barriers that keep women and minorities from entering computing and technology fields. Her combination of technical expertise and fearless vision continues to inspire and motivate countless women to become active participants and leaders in creating technology.

    As part of Google's ongoing commitment to furthering Anita's vision, we are pleased to announce the 2006 Google Australia Anita Borg Scholarship. Through the scholarship, we would like to encourage women to excel in computing and technology and become active role models and leaders.

    Scholarships will be awarded based on the strength of candidates' academic background and demonstrated leadership. A group of female undergraduate and postgraduate student finalists will be chosen from the applicant pool. The scholarship recipients, selected from the finalists, will each receive a $5,000 AUD scholarship for the 2007 academic year.

    All finalists will be invited to visit Google Sydney in November 2006 for a networking retreat. It will include workshops with a series of speakers, breakout sessions and social activities. The visit is meant to be an opportunity for all finalists to meet and share their experiences.


    If that sounds interesting to you and you're a lady studying computing or a related field, then you should checkout the announcement page before it's too late.

    Tags for this post: google(S)

posted at: 11:23 | path: /google | permanent link to this entry


Sun, 20 Aug 2006



Mountain View WiFi

    I'm sitting in a park in Mountain View at the moment, and the Mountain View Google WiFi works just fine. That's totally cool. It makes me think about all those random crazy projects I can now implement where a computer in my car needs an internet connection to work right. Hmmmmmm... I guess that's another good use for a slug.

    Tags for this post: google(S) wifi(S)

posted at: 15:45 | path: /google/wifi | permanent link to this entry


Tue, 27 Jun 2006



Holy crap!

    These guys really did deliver 1,000 pizzas to Google's Mountain View campus. We even ate them. I guess that's one way of getting publicity...

    Tags for this post: google(S)

posted at: 18:18 | path: /google | permanent link to this entry


Wed, 15 Feb 2006



Kinderplex

    The kids are the in the Kinderplex today (the Google-only child care center). It's the first time I've dropped Matthew off for care and he hasn't gone ape -- I think it's because he loved the center so much... There are computers in every room, and it's probably the nicest laid out and supplied child care center I have ever seen. It makes me wonder if I should be sending Andrew there next year for pre-school.

    Tags for this post: google(S)

posted at: 14:37 | path: /google | permanent link to this entry


Thu, 12 Jan 2006



Cool people I have met at work

    The guys behind the PKD android project -- very cool in a geeky way. Jimmy Carter -- very cool in an unbreaking the world way.

    Oh, and apparently you're always a President, even if you're no longer in office, and you're meant to stand when a President enters the room. Oh, and clapping means "yes".

    Tags for this post: google(S)

posted at: 16:48 | path: /google | permanent link to this entry


Mon, 14 Nov 2005



Giving Google Analytics a go

posted at: 02:43 | path: /google | permanent link to this entry


Thu, 03 Nov 2005



What's happening with frozenchicken.com?

    Gordon at work asks me what is happening with www.frozenchicken.com. If you hit the site, then you get the Google search interface. This is because of the DNS configuration for the domain:

      challenger:~# host www.frozenchicken.com
      www.frozenchicken.com is an alias for www.google.com.
      www.google.com is an alias for www.l.google.com.
      www.l.google.com has address 66.102.7.147
      www.l.google.com has address 66.102.7.99
      www.l.google.com has address 66.102.7.104
      www.frozenchicken.com is an alias for www.google.com.
      www.google.com is an alias for www.l.google.com.
      www.frozenchicken.com is an alias for www.google.com.
      www.google.com is an alias for www.l.google.com.
      


    You can see that www.frozenchicken.com is an alias for www.google.com, which in turn points to what is presumably my local cluster.

    So why do all the links of the Google page then point via www.frozenchicken.com? Well, because they're relative URLs, they use the hostname from the browser.

    Tags for this post: google(S)

posted at: 15:21 | path: /google | permanent link to this entry


Fri, 07 Oct 2005



A first taste of Google blog reader

    So, Google has released a beta of their bloglines equivalent service, and given that Liferea crashes about four times a day for me I thought I would give it a go. Login et cetera is easy, and the user interface is nice and AJAXy. It's fairly intuitive as well, although when I was importing my OPML file from Liferea I missed the message at the top saying the import was in progress as first.

    That said, it's been 30 minutes and it still says it's importing my 460 line OPML file. I just refreshed the page for the import, and the import stopped and said that I now had 54 subscriptions. So, I guess that means I should wait longer for the import. I'm now going to try importing over the top and see if it's smart enough to squelch duplicates.

    Tags for this post: google(S)

posted at: 14:35 | path: /google | permanent link to this entry


Sun, 04 Sep 2005



Why does every man and his dog put man pages online?

    So, I know that I have a few man pages online, but then again I wrote either the code they document, or some of the generation toolchain to create them, so I think that is different. Why does every man and his dog feel that he should put man pages online? It actually makes it really hard to search for things if the first page of Google results are the same man page over and over again from sites who seem to think that they're making a contribution to the community.

    Are they just doing this to grab some pagerank?

    Tags for this post: google(S)

posted at: 01:28 | path: /google | permanent link to this entry


Tue, 23 Aug 2005



Alternate queries on results pages making it easier for future evilness?

    John Battelle implies that the new search result page being testing by Google could make evilness easier in the future. The premise is that offering alternate queries might be useful now, but it would make it easier to insert paid listings later.

    I'm confused though, and John doesn't have a comment link in his RSS output, so I'll post it here. Surely if Google wanted to embrace evil later, they could just direct their coders to make it happen? They already know what keywords you're searching for (i.e. Adwords), couldn't they just roll those into the page in a way which looks like search results? I see no real way this positions for future evil.

    I've been keeping an eye on Google news recently, and there seems to be a propensity towards paranoia in a lot of people (for instance the gmail displaying Adwords thing). If people are bothered, why don't they just use another search engine? You can't tell me that MSN and Yahoo! are any less evil...

    Tags for this post: google(S)

posted at: 01:17 | path: /google | permanent link to this entry