Created
April 11, 2017 01:23
-
-
Save psema4/66b942db80f866cf59d91a7a5c3c9faa to your computer and use it in GitHub Desktop.
Unity Asset Store Bookmarklet
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
</head> | |
<body> | |
<h1>Get Unity Packages as JSON</h1> | |
<p>Retrieves basic information about your Unity Asset Store assets in JSON format.</p> | |
<h2>Instructions</h2> | |
<ol> | |
<li>Copy this html file to your Desktop</li> | |
<li>Double click the file to open it</li> | |
<li>Drag the appropriate link for your operating system below up to your bookmarks bar</li> | |
<li>Open the <a href="https://www.assetstore.unity3d.com">Unity Asset Store</a></li> | |
<li>Login</li> | |
<li>Click on your Downloads icon</li> | |
<li>Optional: Clear any previously saved search options</li> | |
<li>Click on the new 'Get Unity Packages as JSON' bookmarklet in your bookmarks bar</li> | |
</ol> | |
<p>This will download information about your packages to your Downloads folder as a json file.</p> | |
<h2>Bookmarklets</h2> | |
<h3>OSX</h3> | |
<a href='javascript:void(function(){function download(filename,text){var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(text));element.setAttribute("download",filename);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}function parsePage(){var packagesDOM=document.querySelectorAll(".package-details"),packages={};window.packagesDOM=packagesDOM;[].forEach.call(packagesDOM,function(package){var id=package.dataset.id,image=package.firstElementChild.firstElementChild.firstElementChild.src,title=package.firstElementChild.firstElementChild.title,link=package.firstElementChild.firstElementChild.href,category=package.querySelector(".category").firstElementChild.title,publisher=package.querySelector(".category").previousElementSibling.firstElementChild.title,path="~/Library/Unity/Asset Store-5.x/"+publisher+"/"+category.replace(/\//g,""),packageObject={id:id,image:image,category:category,title:title,publisher:publisher,path:path,link:link};packages[title]=packageObject});if(packages){window.packages=packages;console.table(packages);download("unity-packages.json",JSON.stringify(packages,null,4))}}parsePage()})();'>Get Unity Packages as JSON</a> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment