Skip to content

Instantly share code, notes, and snippets.

@TrevorJTClarke
Created January 21, 2016 22:21
Show Gist options
  • Save TrevorJTClarke/2c126e193cbc218c6007 to your computer and use it in GitHub Desktop.
Save TrevorJTClarke/2c126e193cbc218c6007 to your computer and use it in GitHub Desktop.
Extract your sitespeed.io results into importable cvs
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