#!/bin/bash #Danbooru Tag Update Script V. 1.0 by Christopher Beley #Get the new File names xml sel -T --net -t -m "//post" -v @file_name --nl http://danbooru.donmai.us/api/find_posts?tags=$1&limit=9999999999999 > newfiles IFS=$'\n' for NAME in $(cat masterlist) do sed -ie "\|^$NAME\$|d" newfiles done #append newfiles to the master list cat newfiles >> masterlist cat newfiles | while read line do randnum=$RANDOM let "randnum %= 7" case $randnum in "0") wget -P $1 http://danbooru.lolitron.org/data/${line} ;; "1") wget -P $1 http://dan.paramnesiac.net/data/${line} ;; "2") wget -P $1 http://pooshlmer.com/danbooru/data/${line} ;; "3") wget -P $1 http://saguratus.com/danbooru/data/${line} ;; "4") wget -P $1 http://danbooru.imouto.org/data/${line} ;; "5") wget -P $1 http://danbooru.zomgwtf.net/data/${line} ;; "6") wget -P $1 http://danbooru.sr3r.net/data/${line} ;; "7") wget -P $1 http://danbooru.fatechan.net/data/${line} ;; *) echo "Something Went Wrong..." ;; esac done