Last active
December 22, 2015 23:29
-
-
Save cbednarski/6546719 to your computer and use it in GitHub Desktop.
Pull a list of octocats and their creators from http://octodex.github.com/
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
| var items = []; | |
| var pics = jQuery('.item-shell'); | |
| for (var i in pics) { | |
| if (i < 165) { // Hack | |
| var artist = jQuery(pics[i]).find('.footer>a'); | |
| var item = { | |
| "name":jQuery(pics[i]).find('.purchasable a').html(), | |
| "url" :jQuery(pics[i]).find('.preview-image img').attr('src') | |
| }; | |
| if (artist.length > 0) { | |
| item.artist = artist.attr('href').split('/')[3]; | |
| } | |
| if(item.artist == undefined) { | |
| item.artist = 'unknown'; | |
| } | |
| items[i] = item; | |
| } | |
| } | |
| JSON.stringify(items); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment