summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/cdxcat0
-rw-r--r--bin/cdxcut0
-rwxr-xr-xbin/cdxget7
-rwxr-xr-xbin/urlkey2url8
4 files changed, 15 insertions, 0 deletions
diff --git a/bin/cdxcat b/bin/cdxcat
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/cdxcat
diff --git a/bin/cdxcut b/bin/cdxcut
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/bin/cdxcut
diff --git a/bin/cdxget b/bin/cdxget
new file mode 100755
index 0000000..a54612d
--- /dev/null
+++ b/bin/cdxget
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+url='http://web.archive.org/cdx/search/cdx?'
+for arg in "$@"; do
+ url+="$s${arg%%=*}=$(printf '%s' "${arg#*=}"|urlencode)&"
+done
+curl -s "$url"
diff --git a/bin/urlkey2url b/bin/urlkey2url
new file mode 100755
index 0000000..5d0ec3d
--- /dev/null
+++ b/bin/urlkey2url
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+for arg in "$@"; do
+ keydomain="${arg%%)*}"
+ keypath="${arg#*)}"
+ domain="$(IFS=,; printf '%s\n' $keydomain|tac|xargs|tr ' ' '.')"
+ echo "$domain$keypath"
+done