Skip to content

Instantly share code, notes, and snippets.

@rrampage
Created September 28, 2023 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrampage/d4b286091f9a9b9d0b287a53836077ff to your computer and use it in GitHub Desktop.
Save rrampage/d4b286091f9a9b9d0b287a53836077ff to your computer and use it in GitHub Desktop.
Search wayback machine for URL
#!/bin/bash
# Search Wayback machine for a particular URL
# Add to your ~/.bashrc or ~/.bash_profile
# Needs `jq` and `curl` to work
if [[ -z $1 ]]; then
echo "Usage: $0 URL";
else
curl "http://web.archive.org/cdx/search/cdx?url=$1*&output=json&fl=original,timestamp" 2> /dev/null | jq '.[1:][] |"https://web.archive.org/web/" +.[1] + "/" + .[0]' 2> /dev/null;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment