summaryrefslogtreecommitdiff
path: root/cdx_json
diff options
context:
space:
mode:
Diffstat (limited to 'cdx_json')
-rwxr-xr-xcdx_json7
1 files changed, 7 insertions, 0 deletions
diff --git a/cdx_json b/cdx_json
new file mode 100755
index 0000000..81284af
--- /dev/null
+++ b/cdx_json
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+url='http://web.archive.org/cdx/search/cdx?output=json'
+for arg in "$@"; do
+ url+="&${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)"
+done
+curl -s "$url"