blnk_me / GB rating

// ==UserScript==
// @name         GB rating
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  display projects rating
// @author       blnk_me
// @match        https://gb.kyivcity.gov.ua/projects/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    // Your code here...
    var votes = parseInt($(".votes-count strong").text());
    var amount = parseInt($(".amount strong").text().replace(/ /g,''));
    var rating = votes / amount;
    var multipliedRating = parseInt(rating * 10000000);
    var showRating = function(){
        if(!$("#rating").length){
            $(".votes-count").append("<p id='rating'>Рейтинг: "+multipliedRating+" </p>");
            // $(".votes-count").append("<p id='raw-rating'>("+rating+")</p>");
        }
    };
    var interval = setInterval(function(){
        showRating();
    }, 200);
})();