import re
import json


def get_instagram_shared_data(text):
    """
    Given a Instagram HTML page, return the
    'shared_data' json object
G
    Args:
        text: Raw html source for instagram

    Returns:
        dict containing the json blob thats in
        instagram.com
    """
    json_blob = re.findall(r"window._sharedData\s=\s(.+);</script>", text)[0]
    return json.loads(json_blob)