Save user statistics

Post Reply
mettasattva
Posts: 1
Joined: Sun May 03, 2015 8:07 am

Save user statistics

Post by mettasattva »

It should be possible for site to use cookies or save data on the users computer in some way. Obviously such information won't be available to other users and it would be impossible to create a ranking for non-pro users, but at least it will be possible for a rudimentary saving of user data.
People could save such data themselves and it will be easy for people to change their stats, but since it won't be visible to others it would be pointless.
HTML local storage is supported by main browsers since 2010

Code: Select all

<!DOCTYPE html>
<html>
<body>

<div id="result"></div>

<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
    // Store
    localStorage.setItem("lastname", "Jason");
    // Retrieve
    document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
    document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";
}
</script>

</body>
</html>
This code is from w3schools, it saves lastname:Jason on the clients computer and so does not contribute to server memory load. It is the clients computer that would retrieve the information from the file and it could be coded so the clients computer performs all the relevant calculations too. So the server CPU load will be minimal, i.e. request to the client for statistics to be retrieved from local storage and displayed on client.

Finally, it's already possible for people to code their own extension to save the go statistics but unfortunately I don't think there is a way for your site to accept these statistics in as much as if I reached 15 kyu problems on thursday and my extension recorded this, but on sunday the data has been deleted. Now when I use goproblems again the next problem will be 30 kyu, and if my extension recorded the rating history, would display that I rapidly declined from 15 kyu to 30 kyu. I really like using this site and I think that the addition of this feature might make it even better. But it could be quite an ordeal to recode for this.

There may not be that many people who want to see this feature implemented. So if everyone who actually does want this would reply or something, it would show that this change would be popular or if not that it wouldn't be worth the effort to implement it

(I think that Java can also create files and could be used to make a directory specifically for the purpose in the home directory, circumventing browser limitations. I'm going to try and write a java applet that could do this.)
Post Reply