From 305911482ac3ea8c988d35765aa7e4f2c8f5d203 Mon Sep 17 00:00:00 2001 From: Lesutachi <30676084+Lesutachi@users.noreply.github.com> Date: Sat, 15 May 2021 00:48:02 -0300 Subject: [PATCH 1/2] Band Discography scrapper --- tuxi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tuxi b/tuxi index 0078bd5..6669eef 100755 --- a/tuxi +++ b/tuxi @@ -58,6 +58,7 @@ esac # you can disable tests by commenting out the line(s) priority=" tracklist # Album track lists ( eg: noisia outer edges tracklist ) +discography # Band Discography ( eg: meshuggah albums ) richcast # Rich Rich Answers ( eg: social network cast ) define # Define ( eg: define Aggrandize ) lists # Simple lists ( eg Need for Speed Heat cars list ) @@ -741,6 +742,13 @@ a_tracklist() { fi fi } +# Band Discography ( eg: meshuggah discography ) // credit @lesutachi +a_discography() { + # Unsorted + # echo "$google_html" | pup 'a.MiPcId json{}' | jq -r '.[].children[].title' | recode html..ISO-8859-1 + # Sorted by year + echo "$google_html" | pup 'a.MiPcId json{}' | jq -r '.[].children[].title' | sed 's@\(.*\)\(([0-9]\{4\}\)\(.*\)@\2:;:\1:;:\3@' | sort | sed 's@\(.*\):;:\(.*\):;:\(.*\)@\2\1\3@' | recode html..ISO-8859-1 +} ############################### ##### Functions ##### From 14d66e272ac4d17f4e740ab83d359e895390418a Mon Sep 17 00:00:00 2001 From: Lesutachi <30676084+Lesutachi@users.noreply.github.com> Date: Sat, 15 May 2021 01:02:23 -0300 Subject: [PATCH 2/2] simplified the discography scrapper sorter a bit --- tuxi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuxi b/tuxi index 6669eef..d7fcbdd 100755 --- a/tuxi +++ b/tuxi @@ -747,7 +747,7 @@ a_discography() { # Unsorted # echo "$google_html" | pup 'a.MiPcId json{}' | jq -r '.[].children[].title' | recode html..ISO-8859-1 # Sorted by year - echo "$google_html" | pup 'a.MiPcId json{}' | jq -r '.[].children[].title' | sed 's@\(.*\)\(([0-9]\{4\}\)\(.*\)@\2:;:\1:;:\3@' | sort | sed 's@\(.*\):;:\(.*\):;:\(.*\)@\2\1\3@' | recode html..ISO-8859-1 + echo "$google_html" | pup 'a.MiPcId json{}' | jq -r '.[].children[].title' | sed 's@\(.*\)\(([0-9]\{4\}\)\(.*\)@\2:;:\1\2\3@' | sort | sed 's@\(.*\):;:@@' | recode html..ISO-8859-1 } ###############################