diff options
Diffstat (limited to 'bin/cdxget')
-rwxr-xr-x | bin/cdxget | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,7 +1,15 @@ #!/usr/bin/env bash +# Copyright (c) 2017, 2023 Luke Shumaker <lukeshu@lukeshu.com> +# +# This work is free. You can redistribute it and/or modify it under +# the terms of the Do What The Fuck You Want To Public License, +# Version 2, as published by Sam Hocevar. See the COPYING file for +# more details. -url='http://web.archive.org/cdx/search/cdx?' +url='http://web.archive.org/cdx/search/cdx' +s='?' for arg in "$@"; do - url+="$s${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)&" + url+="$s${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)" + s='&' done -curl -sL "$url" +curl -sfL "$url" |