webcache/archiveorg.py
def download_cache(cache_url):
        """
        Download cache from a cache url
        """
        if cache_url.startswith('https://web.archive.org/web/') or \
            cache_url.startswith('http://web.archive.org/web/'):
            r = requests.get(cache_url)
            data = r.text
            t1 = data.find('<!-- End Wayback Rewrite JS Include -->')
            cached_data = '<!doctype html>\n<html>\n<head>' + data[t1+39:]
            if cache_url.startswith('http://'):
                date = parse(cache_url[27:41])
            else:
                date = parse(cache_url[28:42])
            return {
                'success': True,
                'data': cached_data,
                'date': date,
                'cacheurl': cache_url
            }
        else:
            return {'success': False}

        Download cache from a cache url
        
Download cache from a cache url
Download cache from a cache url
def download_cache(cache_url):
        if cache_url.startswith('https://web.archive.org/web/') or \
            cache_url.startswith('http://web.archive.org/web/'):
            r = requests.get(cache_url)
            data = r.text
            t1 = data.find('<!-- End Wayback Rewrite JS Include -->')
            cached_data = '<!doctype html>\n<html>\n<head>' + data[t1+39:]
            if cache_url.startswith('http://'):
                date = parse(cache_url[27:41])
            else:
                date = parse(cache_url[28:42])
            return {
                'success': True,
                'data': cached_data,
                'date': date,
                'cacheurl': cache_url
            }
        else:
            return {'success': False}
def download_cache ( cache_url ) : if cache_url . startswith ( 'https://web.archive.org/web/' ) or cache_url . startswith ( 'http://web.archive.org/web/' ) : r = requests . get ( cache_url ) data = r . text t1 = data . find ( '<!-- End Wayback Rewrite JS Include -->' ) cached_data = '<!doctype html>\n<html>\n<head>' + data [ t1 + 39 : ] if cache_url . startswith ( 'http://' ) : date = parse ( cache_url [ 27 : 41 ] ) else : date = parse ( cache_url [ 28 : 42 ] ) return { 'success' : True , 'data' : cached_data , 'date' : date , 'cacheurl' : cache_url } else : return { 'success' : False }
Download cache from a cache url
Download cache from a cache url
"""
        Download cache from a cache url
        """
cache_url