Created
January 21, 2016 22:21
-
-
Save TrevorJTClarke/2c126e193cbc218c6007 to your computer and use it in GitHub Desktop.
Extract your sitespeed.io results into importable cvs
This file contains hidden or 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
var all = $('a[data-html="true"]'); | |
var done = []; | |
$.each(all, function(idx, item){ | |
var fin = $(item).parent().parent()[0].innerText.split('\n'); | |
var first = fin[0] + ';'; | |
var second = fin[1].split(' (')[0] + ';'; | |
var third = fin[1].split(' (')[1].replace(')', '') + '\n'; | |
var i = first + second + third; | |
done.push(i); | |
}); | |
console.log(done.toString().replace(/\"/g, '').replace(/,/g, '').replace(/;/g, ',')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment