summaryrefslogtreecommitdiff
path: root/bin/cdxget
diff options
context:
space:
mode:
Diffstat (limited to 'bin/cdxget')
-rwxr-xr-xbin/cdxget14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/cdxget b/bin/cdxget
index 46d56c4..1dbc8f0 100755
--- a/bin/cdxget
+++ b/bin/cdxget
@@ -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"