Created
August 14, 2013 01:55
-
-
Save r-sal/6227393 to your computer and use it in GitHub Desktop.
cdnjs.com Extract, save as window.cdnjs and output as JSON string.
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
| /** | |
| * http://cdnjs.com/ | |
| * Extract, save as window.cdnjs and output as JSON string. | |
| */ | |
| window.cdnjs = {}; | |
| $('#example').find('tr').each(function(){ | |
| var name = $(this).attr('data-library-name'), | |
| url = $(this).find('p[itemprop="downloadUrl"]').text(), | |
| description = $(this).find('[itemprop="description"]').text(), | |
| libUrl = $(this).find('[itemprop="url"]').attr('content'), | |
| ver = $(this).find('[itemprop="version"]').attr('content'); | |
| cdnjs[name] = { 'name' : name, 'url' : url, 'description' : description, 'version' : ver, 'project' : libUrl }; | |
| }); | |
| console.log(window.cdnjs); | |
| //console.log(JSON.stringify(cdn)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment