Ok, thank you LShetty. It worked, heres the complete code:
$(document).ready(function() {
runCode();
function runCode() {
var uri = "your url to github";
var totalCom = 0;
$.getJSON(uri, function(r) {
for (var i = 0; i < r[0].total; i++) {
totalCom = r[0].total;
}
//count numbers from zero
$({countNum:
$('.row-one-first .number').text()}).animate({countNum: totalCom}, {
duration: 5000,
easing:'linear',
step: function() {
// What todo on every count
$('.row-one-first .number').text(Math.floor(this.countNum));
},
complete: function() {
$('.row-one-first .number').text(this.countNum);
}
});
})
}
setInterval (function() {
runCode();
}, 300000);
});