Greasy Fork Script Rating Count

Shows you what ratings your scripts have.

Ekde 2015/04/22. Vidu La ĝisdata versio.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Greasy Fork Script Rating Count
// @namespace    http://userscripts.org/users/zackton
// @description  Shows you what ratings your scripts have.
// @include      https://greasyfork.org/*/users/*
// @run-at       document-end
// @grant        none
// @version      1.4
// ==/UserScript==

if (window.location.href.indexOf("ratings") == -1) {
    var url = document.URL;
    url += "?sort=ratings"
    window.location.href = url;
} else {
    Exec();
};

function Exec() {
    var USList = document.getElementsByClassName("script-list")[0].children;
    var Creator = document.title;
    var DiscArr = ["Comments on your Script:",""];
    var GoodArr = ["\n","","Scripts with Good ratings:",""];
    var OKArr = ["\n","","Scripts with OK ratings:",""];
    var BadArr = ["\n","","Scripts with Bad ratings:",""];

    for (var j = 0; j < document.getElementsByClassName("discussion-list")[0].children.length; j++) {
        if (document.getElementsByClassName("discussion-list")[0].children[j].getElementsByTagName("a")[3].innerHTML != Creator) {
            DiscArr.push(document.getElementsByClassName("discussion-list")[0].children[j].getElementsByTagName("a")[0].innerHTML + ": " + document.getElementsByClassName("discussion-list")[0].children[j].getElementsByTagName("a")[3].innerHTML);
        };
    };

    for (var i = 0; i < USList.length; i++) {
        if ((USList[i].children[0].children[1].children[7].children[0].children[0].innerHTML) > 0) {
            GoodArr.push((USList[i].children[0].getElementsByTagName("a")[0].innerHTML)+(": " + USList[i].children[0].children[1].children[7].children[0].children[0].innerHTML));
        };
        if ((USList[i].children[0].children[1].children[7].children[0].children[1].innerHTML) > 0) {
            OKArr.push((USList[i].children[0].getElementsByTagName("a")[0].innerHTML)+(": " + USList[i].children[0].children[1].children[7].children[0].children[1].innerHTML));
        };
        if ((USList[i].children[0].children[1].children[7].children[0].children[2].innerHTML) > 0) {
            BadArr.push((USList[i].children[0].getElementsByTagName("a")[0].innerHTML)+(": " + USList[i].children[0].children[1].children[7].children[0].children[2].innerHTML));
        };
    };

    DiscArr = DiscArr.join("\n");
    GoodArr = GoodArr.join("\n");
    OKArr = OKArr.join("\n");
    BadArr = BadArr.join("\n");

    if (DiscArr.endsWith("\n") == true) {
        DiscArr = DiscArr.concat("\n","None.");
    };
    if (GoodArr.endsWith(0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9) == false) {
        GoodArr = GoodArr.concat("\n","None.");
    };
    if (OKArr.endsWith(0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9) == false) {
        OKArr = OKArr.concat("\n","None.");
    };
    if (BadArr.endsWith(0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9) == false) {
        BadArr = BadArr.concat("\n","None.");
    };

    alert(DiscArr + GoodArr + OKArr + BadArr);
};