Skip to content

Instantly share code, notes, and snippets.

@VictorWesterlund
Forked from wcaleb/waybackup.py
Last active January 27, 2021 05:22
Show Gist options
  • Save VictorWesterlund/0cd95a1c390dbce9546df79f670089fd to your computer and use it in GitHub Desktop.
Save VictorWesterlund/0cd95a1c390dbce9546df79f670089fd to your computer and use it in GitHub Desktop.
Quick script to save URL to Wayback Machine with Python 3
#!/usr/bin/python3
import sys, requests
# Usage: Pass URL to script, get back URL to Wayback Machine snapshot
base_url = 'http://web.archive.org'
try:
r = requests.get(f"{base_url}/save/{sys.argv[1]}")
r.raise_for_status()
except r.exceptions.RequestException as e:
raise SystemExit(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment