Add a Bandcamp DCGI to list all the discography of an artist - gophercgis - Collection of gopher CGI/DCGI for geomyidae
(HTM) hg clone https://bitbucket.org/iamleot/gophercgis
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) changeset 3f82cd051ef0fa1eeaa8bb90db994a28673e4c3a
(DIR) parent 146e52c4312ce865597cbaaed0c3ab4d9d479985
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Wed, 29 Aug 2018 12:48:21
Add a Bandcamp DCGI to list all the discography of an artist
Diffstat:
bandcamp/music.dcgi | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
---
diff -r 146e52c4312c -r 3f82cd051ef0 bandcamp/music.dcgi
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/bandcamp/music.dcgi Wed Aug 29 12:48:21 2018 +0200
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+ALBUM_CGI="/cgi/bandcamp/album.dcgi"
+
+artist="$2"
+url="https://${artist}.bandcamp.com"
+
+
+echo "t"
+echo "tBandcamp"
+echo "t"
+
+/usr/bin/ftp -V -o - "${url}/music" |
+{ xmllint --html --xpath 'string(//ol/@data-initial-values)' - 2>/dev/null ; } |
+/usr/pkg/bin/jq -r '
+.[] |
+ "[1|\((.title + " - " + .band_name) | gsub("\\|"; "\\|"))|" +
+ "'"${ALBUM_CGI}?${url}"'\(.page_url | gsub("\\|"; "\\|"))|server|port]",
+ "Released: \(.release_date)",
+ "Published: \(.publish_date)",
+ ""
+'