How to use the wayback.Wayback function in wayback

To help you get started, we’ve selected a few wayback examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kpurdon / waybacklapse / wayback / waybacklapse.py View on Github external
def cli(url, beginning, end, collapse, speed, limit, width, height, verbose, allow_redirects):
    """
    Generate a GIF of a given website over a given time range.
    """

    items = wayback.Wayback(url, limit, beginning, end, collapse).search()
    
    if not os.path.exists(TMP_OUTPUT_DIR):
        os.mkdir(TMP_OUTPUT_DIR)

    # not sure how to correctly set this, trial and error...
    with Pool(processes=12) as pool:
        pool.starmap(capture_url, zip(items, repeat(width), repeat(height),
                                      repeat(allow_redirects)))

    output_fn = create_output_fn(url)

    cmd = 'convert'
    cmd += ' -delay {0}'.format(speed)
    cmd += ' {0}'.format(os.path.join(TMP_OUTPUT_DIR, '*.png'))
    if verbose:
        cmd += ' -verbose'

wayback

Python API to Internet Archive Wayback Machine

BSD-3-Clause
Latest version published 11 months ago

Package Health Score

62 / 100
Full package analysis