{"size": 594, "ext": "js", "max_stars_repo_path": "04.Async Programming Lab/01.GithubCommits.js", "max_stars_repo_name": "SonicTheCat/JS-Applications", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "04.Async Programming Lab/01.GithubCommits.js", "max_issues_repo_name": "SonicTheCat/JS-Applications", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "04.Async Programming Lab/01.GithubCommits.js", "max_forks_repo_name": "SonicTheCat/JS-Applications", "max_forks_repo_forks_event_min_datetime": "2018-12-14T12:33:38.000Z", "max_forks_repo_forks_event_max_datetime": "2021-08-16T02:18:05.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 29.7, "max_line_length": 87, "alphanum_fraction": 0.5387205387}
function loadCommits() {
    let username = $("#username").val();
    let repo = $("#repo").val();
    let list = $("#commits");

    $.get(`https://api.github.com/repos/${username}/${repo}/commits`)
        .then(printCommits)
        .catch(handleError);

    function printCommits(commits) {
        list.empty();
        for (let obj of commits) {
            list.append($(`<li>${obj.commit.author.name}: ${obj.commit.message}</li>`))
        }
    }
    function handleError(err) {
        list.empty();
        list.append($(`<li>Error: ${err.status} (${err.statusText})</li>`));
    }
}