Demo entry 6345795

hsdgfsdfsd

   

Submitted by anonymous on Feb 08, 2017 at 12:36
Language: Python. Code size: 512 Bytes.

def is_valid_url(url):
    MAX_URL_DEPTH = 2

    parsed_url = urlparse(url)

    checks = {
        'looks_like_url': validators.url(url),
        'within_depth_limit': len(parsed_url.path.split('/')) - 1 <= MAX_URL_DEPTH,
        'is_not_sitemap': url != 'http://www.epocacosmeticos.com.br/sitemap',
        'is_not_search_page': parsed_url.path not in {'/busca', '/buscapagina'},
        'doesnt_have_fragment': not parsed_url.fragment,
    }.values()

    return True if all(checks) else False

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).