use proper folders

This commit is contained in:
gutmet 2021-04-02 21:19:44 +02:00
parent 317c8acf1e
commit fe419c5172

View File

@ -3,13 +3,19 @@
set -eu set -eu
tag="$1" 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" 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/.*?(?=&quot)" | while read album; do { curl "https://bandcamp.com/tag/$tag?tab=all_releases&s=random" 2>/dev/null | grep -oP "https://[a-zA-Z0-9\-äöü]*?.bandcamp.com/album/.*?(?=&quot)" | while read album; do
if grep -q "$album" "$visited"; then if grep -rq "$album" "$visitedDir"; then
continue continue
fi fi
echo "$album" echo "$album"