]> Sergey Matveev's repositories - mirror.git/commitdiff
Initial commit master
authorSergey Matveev <stargrave@stargrave.org>
Sun, 19 Sep 2021 17:37:32 +0000 (20:37 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 19 Sep 2021 17:39:33 +0000 (20:39 +0300)
common.rc [new file with mode: 0644]
page [new file with mode: 0755]
site [new file with mode: 0755]

diff --git a/common.rc b/common.rc
new file mode 100644 (file)
index 0000000..3b262fd
--- /dev/null
+++ b/common.rc
@@ -0,0 +1,14 @@
+user_agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27"
+
+opts=(
+    --page-requisites
+    --convert-links
+    --adjust-extension
+    --restrict-file-names=ascii
+    --span-hosts
+    --random-wait
+    --execute robots=off
+    --user-agent "$user_agent"
+    --reject "*.woff*,*.ttf,*.js"
+    --tries 10
+)
diff --git a/page b/page
new file mode 100755 (executable)
index 0000000..61cab7b
--- /dev/null
+++ b/page
@@ -0,0 +1,8 @@
+#!/usr/local/bin/zsh
+
+. $0:h/common.rc
+name=$1
+shift
+mkdir -p $name
+cd $name
+wget $opts $@
diff --git a/site b/site
new file mode 100755 (executable)
index 0000000..5ff1419
--- /dev/null
+++ b/site
@@ -0,0 +1,16 @@
+#!/usr/local/bin/zsh
+
+. $0:h/common.rc
+name=$1
+shift
+mkdir -p $name
+cd $name
+opts=(
+    $opts
+    --recursive
+    --timestamping
+    -l inf
+    --no-remove-listing
+    --no-parent
+)
+wget $opts $@