diff --git a/bandcamping b/bandcamping index cf264be..5fda96b 100755 --- a/bandcamping +++ b/bandcamping @@ -3,13 +3,19 @@ set -eu tag="$1" -liked="bandcamping_$tag""_"`date +"%Y%m%d"` -visited="$HOME/.bandcamping.visited" +today=`date +"%Y%m%d"` +visitedDir="$HOME/.bandcamping/visited" +visited="$visitedDir/$today" +likedDir="$HOME/.bandcamping/liked" +liked="$likedDir/$today""_$tag" + +mkdir -p "$visitedDir" +mkdir -p "$likedDir" touch "$visited" { curl "https://bandcamp.com/tag/$tag?tab=all_releases&s=random" 2>/dev/null | grep -oP "https://[a-zA-Z0-9\-äöü]*?.bandcamp.com/album/.*?(?=")" | while read album; do - if grep -q "$album" "$visited"; then + if grep -rq "$album" "$visitedDir"; then continue fi echo "$album"