Skip to content

Instantly share code, notes, and snippets.

@jjjakey
Forked from lats/claim_all_the_things.js
Last active March 16, 2022 13:03
Show Gist options
  • Save jjjakey/afd6da0d64d90051d7469f7729f5ef7f to your computer and use it in GitHub Desktop.
Save jjjakey/afd6da0d64d90051d7469f7729f5ef7f to your computer and use it in GitHub Desktop.
Claims all of the items within the "Bundle for Racial Justice and Equality" 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('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 {
// Download page, return to bundle
window.history.back();
}
}
,3000);
});
@jjjakey
Copy link
Author

jjjakey commented Mar 8, 2022

I dunno if indexOf has different behavior on chrome or if something was updated. This is my hacksaw fix to get the script working again for the new Ukraine bundle. I think itch.io promised a solution to this problem back 2 years ago during the BLM bundle and never delivered afaik; so I don't feel bad anymore just keep the delay ethical if you use this please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment