Skip to content

Instantly share code, notes, and snippets.

@pedroxs
Created March 22, 2018 13:53
Show Gist options
  • Save pedroxs/afff0e5acec682c3b50662c124dfbee3 to your computer and use it in GitHub Desktop.
Save pedroxs/afff0e5acec682c3b50662c124dfbee3 to your computer and use it in GitHub Desktop.
Creates a list of game names and size from Humble Bundle library
// $('div.column.subproducts-holder.js-subproducts-holder').children().slice(0, 5).each(function (i, it) {
$('div.column.subproducts-holder.js-subproducts-holder').children().each(function (i, it) {
let $it = $(it);
$it.click();
let gName = $it.find('h2').text();
while ($(`div.details-heading:contains("${gName}")`) < 1) {
console.log('wait');
}
let $div = $('div.js-download-button.download-button:visible');
let $games = $div.find(':contains("Download")') || $div.find(':contains("Mobile")') || $div.find(':contains("New")') || $div.find(':contains("Web Installer")');
$games.each(function (i, game) {
let $game = $(game).closest('div');
console.log($game.find('span').text().trim() + ' | ' + $game.find('div').text().trim().replace(/(\s+|\n)/g, ' '));
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment