Last active
August 29, 2015 14:23
-
-
Save tiborsaas/5d39f38c2e729e77d09d to your computer and use it in GitHub Desktop.
Export RackExtension list
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
// 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