#!/bin/bash # thepaperwall.com rip #set -x . /home/default NUM=0 . $HOME/.thepaperwall.com DIR="$HOME/Pictures/to_work_on/download/web" #Get the image links lynx -source "http://www.thepaperwall.com/all.php?action=catcontent&c=0&l=100&page=1"| \ grep 'small/small'|\ awk -F\" '{print $10}'|\ awk -F= '{print "http://www.thepaperwall.com/" $NF}'|\ sed 's/small/big/g' > $TMP # Remove old images NAME=`basename $IMG` sed -i '/'"$NAME"'/,$d' $TMP # Get the images for FILE in `cat $TMP` do wget -q -P $DIR $FILE let NUM=NUM+1 done #Get the latest one LAST=`head -n 1 $TMP` if [ -n "$LAST" ] then echo 'IMG='\"$LAST\" > $HOME/.thepaperwall.com fi #Feedback echo "ThePaperwall.com retreived $NUM" exit