'Query a Public Key Server.
This method is based from the pks.py file from the massive enumeration
toolset, coded by pdp and released under GPL v2.'

def met_search(self, query):

    url = URL(u'http://pgp.mit.edu:11371/pks/lookup')
    url.querystring = [(u'op', [u'index']), (u'search', [query])]
    try:
        response = self._uri_opener.GET(url, headers=self._headers, cache=True, grep=False)
    except HTTPRequestException:
        return []
    content = response.get_body()
    content = re.sub('(<.*?>|&lt;|&gt;)', '', content)
    results = []
    accounts = []
    for line in content.split('\n')[2:]:
        if (not line.strip()):
            continue
        tokens = line.split()
        if (len(tokens) >= 5):
            email = tokens[(-1)]
            name = '    '.join(tokens[3:(-1)])
            if SGMLParser.EMAIL_RE.match(email):
                account = email.split('@')[0]
                domain = email.split('@')[1]
                if (domain == query):
                    if (account not in accounts):
                        accounts.append(account)
                        pksr = PKSResult(name, account, domain, response.id)
                        results.append(pksr)
    return results
