Skip to content

Instantly share code, notes, and snippets.

@tcgm
Forked from lats/claim_all_the_things.js
Created April 3, 2024 06:30
Show Gist options
  • Save tcgm/c6c75291e5430338acb71d873d777a2e to your computer and use it in GitHub Desktop.
Save tcgm/c6c75291e5430338acb71d873d777a2e to your computer and use it in GitHub Desktop.
Tampermonkey script to claim all of the items within a Bundle on Itch.io
// ==UserScript==
// @name Activate all Itch.io Bundle downloads
// @version 1
// @include https://itch.io/bundle/download/*
// @include https://*.itch.io/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js
// @grant none
// ==/UserScript==
$(document).ready(function() {
setTimeout(function() {
if (window.location.href.indexOf('https://itch.io/bundle/download/') == 0) {
// Bundle page
var claimButtons = $('button[value="claim"]');
if (claimButtons.length > 0) {
// Claim the first unclaimed game on the page
claimButtons.first().click();
}
else {
// Advance to the next page if all are already claimed
var nextPageButtons = $('a.next_page.button');
if (nextPageButtons.length > 0) nextPageButtons[0].click();
}
}
else if (!window.location.href.indexOf('https://itch.io/bundle/download/') == 0) {
// Download page, return to bundle
window.history.back();
}
}
// Amount of time, in MS, to wait between 'clicks'
,2000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment