Exporting all of your ratings

Posts: 7 Visited by 27 users
Ansercanagicus
endangered bird

Posts: 693


Permalink
+4
11.01.2024 - 13:12
Ansercanagicus
endangered bird

Posts: 693


Through your collection page you can export all your collection and whishlist in .csv or .txt format thanks to the button at the bottom of the page. But there's no tool to keep track of all your ratings, which may not be in your collection.

In order to workaround this, I found that you could go to your ratings page, sort by year, and then execute this script in your browser console to gather data :



function get_ratings(){
vorform = document.querySelector("#votform");
as = votform.querySelectorAll("div>a.maxi");
tables = votform.querySelectorAll("div>table");

i=0;
str="";
for(d of tables){
year = as[i].innerText;


for(tr of d.querySelectorAll("tr")){

band = tr.querySelectorAll("a")[ 0 ].innerText;
album = tr.querySelectorAll("a")[ 1 ].innerText;
rating = tr.children[ 1 ].innerText;

str+= year+", "+band+", "+album+", "+rating+";\n";

}
i+=1;

}

var link = document.createElement("a");
link.innerText = "==> DOWNLOAD CSV <==";
link.download = 'ratings.csv';
var blob = new Blob([str, {type: 'text/csv'}]);
link.href = window.URL.createObjectURL(blob);
link.style.setProperty("background", "brown");
document.querySelector("td.windowbg").appendChild(link);

return str;
} get_ratings();



this will prompt coma separated values in the console, and also add a button in the page, allowing you to download the csv file. (situated near Year | Rating | Band )

_____________
Also, since the primary purpose was to get the average by year:




function average_by_year(){
vorform = document.querySelector("#votform");
as = votform.querySelectorAll("div>a.maxi");
tables = votform.querySelectorAll("div>table");

i=0;
str="";
for(d of tables){
year = as[i].innerText;

sum = 0;
n = 0;
for(tr of d.querySelectorAll("tr")){

rating = parseInt(tr.children[ 1 ].innerText, 10);

sum += rating;
n += 1;
}
i+=1;

average = sum/n;

str+= year+" | "+average.toFixed(2)+" ;\n";

}

div = document.createElement("div");
div.innerText = str;
document.querySelector("td.windowbg").appendChild(div);

return str;
}average_by_year();

----
2026
2025
Loading...
Redel
Moderator

Posts: 2790


Permalink
11.01.2024 - 20:42
Redel
Moderator

Posts: 2790


This is great and very helpful for me. Works perfectly, thanks a lot.
Loading...
Ansercanagicus
endangered bird

Posts: 693


Permalink
11.01.2024 - 22:18
Ansercanagicus
endangered bird

Posts: 693


This many people involved in stats ?



ah yes, maybe I should stop checking every new release... it brings the average down.
I'll try to have the chart version working for anyone
----
2026
2025
Loading...
F3ynman
Nocturnal Bro
Contributor

Posts: 3433


Permalink
11.01.2024 - 22:31
F3ynman
Nocturnal Bro
Contributor

Posts: 3433


Written by Ansercanagicus on 11.01.2024 at 22:18

This many people involved in stats ?



ah yes, maybe I should stop checking every new release... it brings the average down.
I'll try to have the chart version working for anyone

What does the green vs black mean?
Loading...
Ansercanagicus
endangered bird

Posts: 693


Permalink
11.01.2024 - 22:33
Ansercanagicus
endangered bird

Posts: 693


Written by F3ynman on 11.01.2024 at 22:31

What does the green vs black mean?

black is average rating per year, green is number of albums rated
----
2026
2025
Loading...
Roman Doez
Hallucigenia
Contributor

Posts: 1277


Permalink
14.01.2024 - 18:06
Roman Doez
Hallucigenia
Contributor

Posts: 1277


Written by Ansercanagicus on 11.01.2024 at 22:18

This many people involved in stats ?



ah yes, maybe I should stop checking every new release... it brings the average down.
I'll try to have the chart version working for anyone

And to think I gathered the data for my stats series manually
Loading...
Ansercanagicus
endangered bird

Posts: 693


Permalink
14.01.2024 - 18:18
Ansercanagicus
endangered bird

Posts: 693


Written by Roman Doez on 14.01.2024 at 18:06

And to think I gathered the data for my stats series manually

Well if you need other data, we could talk about it. I kinda have the idea if the script when you started talking about stats in the shoutbox (was it years ago?). I'm more confident in what I'm doing now.
----
2026
2025
Loading...