def format_account(service_name, data):
    """
    Given profile data and the name of a
    social media service, format it for
    the zone file.

    @serviceName: name of the service
    @data: legacy profile verification

    Returns the formatted account on success,
    as a dict.
    """
    if 'username' not in data:
        raise KeyError('Account is missing a username')
    account = {'@type': 'Account', 'service': service_name, 'identifier':
        data['username'], 'proofType': 'http'}
    if data.has_key(service_name) and data[service_name].has_key('proof'
        ) and data[service_name]['proof'].has_key('url'):
        account['proofUrl'] = data[service_name]['proof']['url']
    return account
