{"size": 718, "ext": "js", "max_stars_repo_path": "public/js/main.js", "max_stars_repo_name": "f03lipe/bd-gate", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/js/main.js", "max_issues_repo_name": "f03lipe/bd-gate", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/js/main.js", "max_forks_repo_name": "f03lipe/bd-gate", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.6428571429, "max_line_length": 70, "alphanum_fraction": 0.5724233983}

// https://css-tricks.com/snippets/javascript/get-url-variables/
function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0; i<vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {
            return pair[1];
        }
    }
    return false
}

function displayShortenedUrl(url) {
    $(".js-success-strip").removeClass("hidden");
    var url = "/urls/"+url;
    var html = "Your shortened url is <a href='"+url+"'>"+url+"</a>.";
    $(".js-success-strip>.message").html(html);
}

$(function () {
    var url = getQueryVariable("new");
    if (url) {
        displayShortenedUrl(url);
    }
});
