snippets/bandcamping

26 lines
597 B
Plaintext
Raw Normal View History

2021-04-01 23:55:11 +02:00
#!/bin/bash
set -eu
tag="$1"
liked="bandcamping_$tag""_"`date +"%Y%m%d"`
visited="$HOME/.bandcamping.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
if grep -q "$album" "$visited"; then
continue
2021-04-02 00:07:56 +02:00
fi
echo "$album"
2021-04-01 23:55:11 +02:00
surf "$album"
echo -n "Like? "
read -u 3 like
if [ "$like" == "y" ]; then
echo "$album" >> "$liked"
2021-04-02 00:07:56 +02:00
echo "added to $liked"
2021-04-01 23:55:11 +02:00
fi
echo "$album" >> "$visited"
done; } 3<&0