summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile12
-rwxr-xr-xbin/wayfore4
2 files changed, 5 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 07bfa56..d72b0c3 100644
--- a/Makefile
+++ b/Makefile
@@ -39,21 +39,19 @@ dat/index.mk: dat/index.txt
ifneq ($(wildcard dat/index.mk),)
-include dat/index.mk
-dat/content-dir/%/index.wahtml:
+dat/content-dir/%/index.html:
@mkdir -p '$(@D)'
- curl -sfL 'http://web.archive.org/web/$(call murl2url,$*)' > $@
-dat/content-dir/%/index.html: dat/content-dir/%/index.wahtml
- < $< wayfore > $@
+ curl -sfL 'http://web.archive.org/web/$(call murl2url,$(subst /http,id_/http,$*))' > $@
dat/content-dir/%/readme.txt: dat/content-dir/%/index.html
- < $< sed -n '/^<pre>$$/,/<\/pre>/p' | sed -e 1d -e 's,</pre>.*,,' > $@
+ < $< sed -n '/^<[pP][rR][eE]>$$/,/<\/[pP][rR][eE]>/p' | sed -e 1d -e 's,</[pP][rR][eE]>.*,,' > $@
dat/content-dir/%/metadata.txt: dat/content-dir/%/index.html
- < $< grep '^<img' | sed 's/<[^>]*>//g' | grep -vi 'parent directory' | fmt-metadata $(firstword $(subst /, ,$*)) > $@
+ < $< grep -i '^<img' | sed 's/<[^>]*>//g' | grep -vi 'parent directory' | fmt-metadata $(firstword $(subst /, ,$*)) > $@
content-dir = $(foreach u,$(filter %/,$(index)),dat/content-dir/$(call url2murl,$(u)))
download += $(addsuffix readme.txt,$(content-dir)) $(addsuffix metadata.txt,$(content-dir))
dat/content-file/%:
@mkdir -p '$(@D)'
- curl -sfL 'http://web.archive.org/web/$(call murl2url,$*)' > $@
+ curl -sfL 'http://web.archive.org/web/$(call murl2url,$(subst /http,id_/http,$*))' > $@
content-file = $(foreach u,$(filter-out %/,$(index)),dat/content-file/$(call url2murl,$(u)))
download += $(content-file)
diff --git a/bin/wayfore b/bin/wayfore
deleted file mode 100755
index b0bde8a..0000000
--- a/bin/wayfore
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/sed -zrf
-# The opposite of 'wayback'
-s/(<[hH][eE][aA][dD]>).*<!-- End Wayback Rewrite JS Include -->/\1/
-s/<!-- BEGIN WAYBACK TOOLBAR INSERT -->.*<!-- END WAYBACK TOOLBAR INSERT -->//