Skip to content

Instantly share code, notes, and snippets.

@cold-logic
Created October 24, 2017 01:16
Show Gist options
  • Save cold-logic/39adf38dcc2a9957baca90df4ac9897b to your computer and use it in GitHub Desktop.
Save cold-logic/39adf38dcc2a9957baca90df4ac9897b to your computer and use it in GitHub Desktop.
Export a list of Humble Bundle eBooks
{
let a = [], b // Setup local vars
console.clear() // Clear the console
// For each item
$(".gameinfo").each(function() {
// Get the title & subtitle
let title = $(this).find('.title').text().trim()
let subtitle = $(this).find('.subtitle').text().trim()
a.push(`${title} - ${subtitle} #Humble`)
// Add the download URLs
$(this).siblings('.downloads').find('.js-start-download').find('a').each(function() {
a.push(`\t${this.href}`)
})
})
b = a.join("\n") // Add new lines
copy(b) // Copy to clipboard
console.log(b) // Log to console
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment