# Path: oembed/constants.py
# URL_RE = re.compile(URL_PATTERN)
# 
# STANDALONE_URL_RE = re.compile('^\s*' + URL_PATTERN + '\s*$')


import re
import oembed
from django.utils.safestring import mark_safe
from oembed.constants import URL_RE, STANDALONE_URL_RE
from oembed.exceptions import OEmbedException
from oembed.parsers.base import BaseParser




class TextBlockParser(BaseParser):
    def parse_data(self, text, maxwidth, maxheight, template_dir, context,
                   urlize_all_links):
        """
        Parses a block of text indiscriminately
        """
        # create a dictionary of user urls -> rendered responses
        replacements = {}

# Path: oembed/constants.py
# URL_RE = re.compile(URL_PATTERN)
# 
# STANDALONE_URL_RE = re.compile('^\s*' + URL_PATTERN + '\s*$')


# Path: oembed/parsers/text.py
import re
import oembed
from django.utils.safestring import mark_safe
from oembed.constants import URL_RE, STANDALONE_URL_RE
from oembed.exceptions import OEmbedException
from oembed.parsers.base import BaseParser





class TextBlockParser(BaseParser):
    def parse_data(self, text, maxwidth, maxheight, template_dir, context,
                   urlize_all_links):
        """
        Parses a block of text indiscriminately
        """
        # create a dictionary of user urls -> rendered responses
        replacements = {}

        user_urls = set(re.findall(URL_RE, text))