From the Burrow

Robots and social engineering

2010-07-07 00:00:00 +0000

This has been around for a while but it still is lovely. It’s a great example of human engineering and our personification of anything with a recognisable features. Enjoy! TweenBots

p.s. Make sure you check out the videos!

Your country is a product...

2010-07-05 00:00:00 +0000

…and chances are, you aren’t the target demographic

Whack my sausage

2010-07-05 00:00:00 +0000

The other day I sauntered in from work to find the girlfriend and her brother hollering bizarre, two word phrases and cackling while hammering them into google. They were, having just finished watching ‘Dave Gorman’s Googlewhack Adventure’, manically in search of a googlewhack of their own. For the uninitiated a googlewhack is, as laid down by the great Wikipedia

..a kind of a contest for finding a Google search query consisting of exactly two words without quotation marks, that return exactly one hit. A Googlewhack must consist of two actual words found in a dictionary

As each minute passed they each plundered deeper into their lexicons until finally, SCIOLIC NUTCRACKER! A googlewhack, at the time that is; sadly the nature of these things is that once it has been registered, google sees the post and then there are more pages it knows of with the phrase and the googlewhack is no more.

But imminent death aside the glory remained! Al (the brother) had been putting forward many a suggestion with sausage as the second word and was wondering if there were any googlewhacks to be found with his beloved meat product as the star. Of course within a trice my trusty python editor was open and a program was growing…a program to Google search every adjective in a dictionary + sausage!

Alas once you start hammering Google with a good few thousand searches you realise that they all start failing and that you have broken the terms of usage agreement…Bugger

Ah well it was an interesting exercise and as I’m not going to hone a program I cant use, I may as well post it here! Aren’t you grateful, you human receptacle of unwanted programs you?!

Enjoy…and don’t run it,it will only bring momentary smiles and quick, swift dissatisfaction…. insert your own trite conclusion on the nature of life here. Ciao!

#this program tries to find googlewhacks with the second word as sausage!
import sys
from import GoogleSearch, SearchError    
import urllib
import simplejson
from threading import Thread

class whackHunter(Thread):
    def __init__(self, phrase):
        self.phrase = phrase
        self.status = -1
    def run(self):
        query = urllib.urlencode({'q' : self.phrase})
        url = ''\
            % (query,)
        search_results = urllib.urlopen(url)
        json = simplejson.loads(
        result_base = json['responseData']
        if result_base:
            results = result_base['results']
            self.status = len(results)
            self.status = -2

#load in dictionary
dict_file = open("index.adj")
dictionary = (line.split(" ")[0] for line in dict_file)
keep_searching = True
keep_watching = True
hunt_queue = []

while keep_searching:
    while len(hunt_queue)<=5 and keep_watching:
            search_phrase = "%s sausage" % (,)
            new_search = whackHunter(search_phrase)
            "thats the whole barrel!"
    for i in range(len(hunt_queue)-1)[::-1]:
        if hunt_queue[i].status!=-1:
            search = hunt_queue.pop(i)
            if search.status == 1:
                print "OH YEAHHHH! the whack is %s" % (search.phrase,)
                keep_searching= False
            elif search.status == -2:
                print "dead search %s" % (search.phrase,)
                print "no joy with %s" % (search.phrase,)        
print "Done"

Still no musing - Python Select Window and grab Details (alpha)

2010-06-17 00:00:00 +0000

I have had need of a program that gave me the ability to select any window on the desktop and have it return details for me. Turns out there is a lovely command line program specifically for this called ‘xprop’. To use it in python I have called subprocess and got it to rip the results that contain the information I need into a dictionary.

Its very hacky at the mo and will receive plenty of love before it is ready but as I spent so long trying to find out there was a program for this I pretty much had to post it for prosperity.

You have been warned!

import subprocess
import tempfile

class WindowGrabber:
    def __init__(self):
    def window_picker(self):
        out = tempfile.TemporaryFile()
        in_pipe = None
        self.job = subprocess.Popen(["xprop",],
        while self.job.returncode is None:
        result = out.readlines()
        window_details = {}
        for line in result:
            if line.find(" = ") >= 0:
                key, value = line.split(" = ")
                if value.find(", ") >= 0:
                    value = value.split(", ")
                window_details[key] = value
        print ""
if __name__ == "__main__":

A Little Parcel Of Awesome

2010-06-06 00:00:00 +0000

Test from mobile

2010-05-17 00:00:00 +0000

Again another nearly pointless post. This time to test the wordpress android apps. Damn nice it is too!

Salutations Terra

2010-05-16 00:00:00 +0000