summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorPeter2020-09-29 23:51:12 +0100
committerPeter2020-09-29 23:51:12 +0100
commit1944abd74f81173defbfdacc4a1c2cf38c27a910 (patch)
tree6ff1c2883845d181b23dd9095568043efd036a62 /.local/bin
parent53390aaf78c1d44b1aed1438d2bdc24c8a66faf9 (diff)
downloaddotfiles-1944abd74f81173defbfdacc4a1c2cf38c27a910.tar.gz
dotfiles-1944abd74f81173defbfdacc4a1c2cf38c27a910.tar.bz2
dotfiles-1944abd74f81173defbfdacc4a1c2cf38c27a910.zip
Impressive spaghetti, but it all works
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/comicviewer23
1 files changed, 12 insertions, 11 deletions
diff --git a/.local/bin/comicviewer b/.local/bin/comicviewer
index 4121fb3..9cefa85 100755
--- a/.local/bin/comicviewer
+++ b/.local/bin/comicviewer
@@ -1,15 +1,16 @@
#!/bin/bash
input="$1"
-function grab() { curl "$input" --silent ; }
-function viewer() { xargs curl --silent | imv - ; }
+function grab() { curl "$input" -L --silent -A "Mozilla" ; }
+function viewer() { xargs curl --silent -A "Mozilla" | imv - ; }
-if [[ $input =~ xkcd.com ]]
-then
- grab | awk '/hotlinking/ {print $NF}'| viewer
-elif [[ $input =~ dilbert.com ]]
-then
- grab | awk -F\" '/data-image/ {print $2}' | viewer
-else
- echo "Unsupported Website."
-fi
+if [[ $input =~ xkcd.com ]]; then grab | awk '/hotlinking/ {print $NF}'| viewer
+elif [[ $input =~ arcaderage.co ]]; then grab | tr "\"" "\n" | awk -F\? '/uploads/ {print $1;exit}' | viewer
+elif [[ $input =~ Buttersafe ]]; then grab | awk -F\" '/\/comics\// {print $2}' | viewer
+elif [[ $input =~ dilbert.com ]]; then grab | awk -F\" '/data-image/ {print $2}' | viewer
+elif [[ $input =~ explosm.net ]]; then grab | awk -F\" '/main-comic/ {print $4}' | cut -f1 -d\? | sed -e 's/^/"https:/' -e 's/$/"/' | viewer
+elif [[ $input =~ extrafabulouscomics.com ]]; then grab | tr "\"" "\n" | awk -F\? '/uploads/ && /?/ {print $1}' | viewer
+elif [[ $input =~ loadingartist.com ]]; then grab | awk -F\" '/uploads/ {print $8}' | viewer
+elif [[ $input =~ PoorlyDrawnLines ]]; then grab | awk -F"src" '/wp-block-image/ {print $2}' | cut -f2 -d\" | viewer
+elif [[ $input =~ toothpastefordinner.com ]]; then grab | awk -F\" '/max-width/ {print $4}' | viewer
+else echo "Unsupported Website."; fi