Created
January 10, 2016 01:16
-
-
Save breskeby/666800e53cee03ed34cd to your computer and use it in GitHub Desktop.
gradle release history
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="https://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("visualization", "1", {packages:["corechart"]}); | |
google.setOnLoadCallback(drawChart); | |
var pieData = [['Date', 'Version', { role: 'annotation' }]] | |
function drawChart() { | |
var data = google.visualization.arrayToDataTable(pieData); | |
var options = { | |
title: 'Release History', | |
is3D: true, | |
}; | |
var chart = new google.visualization.LineChart(document.getElementById('chart_div')); | |
chart.draw(data, options); | |
google.visualization.events.addListener(chart, 'ready', function () { | |
chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">'; | |
console.log(chart_div.innerHTML); | |
}); | |
chart.draw(data, options); | |
} | |
var jsonString = $.ajax({ | |
url: "https://services.gradle.org/versions/all", | |
dataType: "json", | |
async: false | |
}).responseText; | |
var jsonData = JSON.parse(jsonString) | |
function filterFinalReleases(release) { | |
return !release.snapshot && !release.nightly && release.rcFor == "" | |
} | |
function sinceOneZero(release) { | |
return new Date(release.buildTime.replace(/(\d\d\d\d)(\d\d)(\d\d)(.+)/,"$1-$2-$3")) >= new Date('2012-06-12') | |
} | |
jsonData.filter(filterFinalReleases).filter(sinceOneZero).reverse().forEach(function(release) { | |
var releaseDate = new Date(release.buildTime.replace(/(\d\d\d\d)(\d\d)(\d\d)(.+)/,"$1-$2-$3")) | |
pieData.push([release.version, releaseDate, release.version]) | |
console.log(release.version + " - " + release.buildTime) | |
}) | |
</script> | |
</head> | |
<body> | |
<div id="chart_div" style="width: 2000px; height: 1500px;"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment