def retrieve_and_parse_diaspora_webfinger(handle):
try:<EOL><INDENT>host = handle.split("<STR_LIT:@>")[<NUM_LIT:1>]<EOL><DEDENT>except AttributeError:<EOL><INDENT>logger.warning("<STR_LIT>", handle)<EOL>return None<EOL><DEDENT>document, code, exception = fetch_document(<EOL>host=host, path="<STR_LIT>" % quote(handle),<EOL>)<EOL>if document:<EOL><INDENT>return parse_diaspora_webfinger(document)<EOL><DEDENT>hostmeta = retrieve_diaspora_host_meta(host)<EOL>if not hostmeta:<EOL><INDENT>return None<EOL><DEDENT>url = hostmeta.find_link(rels="<STR_LIT>").template.replace("<STR_LIT>", quote(handle))<EOL>document, code, exception = fetch_document(url)<EOL>if exception:<EOL><INDENT>return None<EOL><DEDENT>return parse_diaspora_webfinger(document)<EOL>
Retrieve a and parse a remote Diaspora webfinger document.

:arg handle: Remote handle to retrieve
:returns: dict