Skip to content

Instantly share code, notes, and snippets.

@prozacgod
Last active August 29, 2015 13:56
Show Gist options
  • Save prozacgod/9032048 to your computer and use it in GitHub Desktop.
Save prozacgod/9032048 to your computer and use it in GitHub Desktop.
Render your GOG shelf to html for posterity.
$('<textarea>').width('800').height('800').val((function(){ var games = $('#shelfGamesList .shelf_game'), username=prompt("Username:")+"'s Shelf"; return "<html><head><title>" + username + "</title><style>body,html{font-family:Arial;background-color:#000;color:#FFF;margin:0;padding:0}\n.shelf_title{font-weight:700;position:relative;width:828px;background-color:#555;text-align:center;margin:0 auto;padding:10px}\n.count{position:absolute;right:15px}\n.shelf_outer{width:828px;background-color:#555;margin:10px auto}\n.shelf_outer:last-child:after{content:" +'""'+ ";display:table;clear:both}\n.game{float:left;border-bottom:15px solid #777;padding:15px 5px}\n.shelf_title a {position: absolute;left:15px;}</style><body><div class='shelf_title'><a href='https://gist.github.com/prozacgod/9032048'>gogShelf.js</a>" + username +"<span class='count'>" + games.length + " Games</span></div><div class='shelf_outer'>" + Array.prototype.slice.call(games.map(function(i, el) { return "<div class='game'><a href='http://www.gog.com/game/" + $(el).data('gameindex') + "'><img src='http://gog.com" + $(el).find('img').attr('src') +"' /></a></div>" }), 0).join("\n") + "</div></body></html>"})()).appendTo($('html').html(''));
// Paste the above mess into chrome (only tested there) console, while you are browsing your account
// @ https://secure.gog.com/account this will strip the page apart and replace it
// with a textarea containing source code to your very own shelf data
// Example - my shelf! http://prozacville.com/GOG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment