def get_ogheader(blob, url=None):
    """extract Open Graph markup into a dict

    The OG header section is delimited by a line of only `---`.

    Note that the page title is not provided as Open Graph metadata if
    the image metadata is not specified.
    """
    found = False
    ogheader = dict()
    for line in blob.split('\n'):
        if line == '---':
            found = True
            break
        if line.startswith('image: '):
            toks = line.split()
            assert len(toks) == 2
            ogheader['image'] = toks[1]
    if not found:
        ogheader = dict()  # Ignore any matches as false positives
        return ogheader
    if url is not None:
        assert 'url' not in ogheader
        ogheader['url'] = url
    for line in blob.split('\n'):
        if line.startswith('# '):
            ogheader['title'] = line[2:]
    return ogheader