summaryrefslogtreecommitdiff
path: root/bin/cdxget
blob: 6844fa6ac38ea955f0d554d14f0920d3234ada2d (plain)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env bash

url='http://web.archive.org/cdx/search/cdx'
s='?'
for arg in "$@"; do
	url+="$s${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)"
	s='&'
done
curl -sfL "$url"