Skip to content

Instantly share code, notes, and snippets.

@cbednarski
Last active December 22, 2015 23:29
Show Gist options
  • Save cbednarski/6546719 to your computer and use it in GitHub Desktop.
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/
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