Skip to content

Instantly share code, notes, and snippets.

@devxoul
Created September 26, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devxoul/89687f704e4017f64e7518c3c7397697 to your computer and use it in GitHub Desktop.
Save devxoul/89687f704e4017f64e7518c3c7397697 to your computer and use it in GitHub Desktop.
Google Analytics OS 버전 합계(%) 구하기
(function() {
var VERSION = '8'
var total = 0;
$('#ID-explorer-table-pieTable tr')
.each(function(i, tr) {
var version = $(tr).find('td:nth-child(3)').text();
if (version.startsWith(VERSION)) {
var percentString = $(tr).find('td:nth-child(5)').text();
var percent = Number(percentString.split('%')[0]);
total += percent;
}
});
console.log(String(total).substr(0, 4) + '%');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment