commit 1a270ec7a905c3cab479582f2a166446ddb4e456 parent e68905330fdb955557f309a1db24a060968915ff Author: clamiax <smoppy@gmail.com> Date: Sun, 5 Jan 2014 23:10:51 +0000 Move getter to a variable. Add some todo items. Diffstat:
M | scrapthumb | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scrapthumb b/scrapthumb @@ -2,6 +2,11 @@ # Scrap Tumblr to get random images # Usage: feh --bg-scale $(scrapthumb -n1 -s http://desktopwallpaperproject.tumblr.com) +# TODO +# - Randomize the sources (-r flag) +# - Handle network errors + +GETTER="wget -t1 -qO -" VIEWER=echo MAXIMGS=5 @@ -26,7 +31,7 @@ preload() { [ $i -eq 0 -a $mod -ne 0 ] && t=$(echo $tot + 1 | bc) || t=$tot for n in $(seq 1 $t) do - IMGS[$i]="$(wget -t 1 -qO - "$src/random" |grep -o 'property="og:image" content=".*"' |cut -b 29- |tr -d '"')" + IMGS[$i]="$($GETTER "$src/random" |grep -o 'property="og:image" content=".*"' |cut -b 29- |tr -d \")" i=$(echo $i+1|bc) done done