Skip to content

Instantly share code, notes, and snippets.

@tiborsaas
Last active August 29, 2015 14:23
Show Gist options
  • Save tiborsaas/5d39f38c2e729e77d09d to your computer and use it in GitHub Desktop.
Save tiborsaas/5d39f38c2e729e77d09d to your computer and use it in GitHub Desktop.
Export RackExtension list
// PRESS (CTRL/Command)+SHIFT+J and paste this code after you loaded all the extensions
var saveHTML = function(fileName, html){
var link = document.createElement("a");
link.download = fileName;
link.href = "data:text/html,"+html;
link.click();
};
var links = document.querySelectorAll('#browse h2');
var prices = document.querySelectorAll('#browse .price');
var category = document.querySelectorAll('#browse .image-overlay');
var desc_links = [].slice.call( document.querySelectorAll('#browse .desc a') );
var developers = desc_links.filter(function(el){ return el.href.indexOf('developer') !== -1 });
var collection = '';
for( i=0; i<links.length; i++){
collection += '<tr><td>' + links[i].innerHTML.trim() + '</td><td>' +
prices[i].innerHTML + '</td><td>' +
developers[i].innerHTML + '</td><td>' +
category[i].innerHTML.trim() + '</td><td>https://shop.propellerheads.se/product/'+ prices[i].dataset.slug + '</td></tr>';
}
saveHTML("export.html", "<html><head><title>Rack extension exports</title><meta charset='utf-8'></head><body><table>"+collection+"</table></body></html>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment