Skip to content

Instantly share code, notes, and snippets.

@gandanimal
Last active November 2, 2025 21:19
Show Gist options
  • Save gandanimal/c4ac273299a959487ec2f123b85c8a93 to your computer and use it in GitHub Desktop.
Save gandanimal/c4ac273299a959487ec2f123b85c8a93 to your computer and use it in GitHub Desktop.
javascript:(()=> {
const img = document.querySelector('img[src*="https://godex.site/images/collections/"]');
if (!img) { alert("No collection image found."); return; }
let filename = img.src.split("/").pop().replace(".svg","");
let collectionPrefix = "";
let isShiny = false;
if (filename.endsWith("-shiny")) {
isShiny = true;
filename = filename.replace("-shiny","");
}
switch(filename){
case "event":
collectionPrefix = "costume&";
break;
case "purified":
collectionPrefix = "shadow,purified&";
break;
case "dmax":
collectionPrefix = "dynamax&";
break;
case "gmax":
collectionPrefix = "gigantamax&";
break;
}
if (isShiny){
collectionPrefix = collectionPrefix ? ("shiny&"+collectionPrefix) : "shiny&";
}
const pokemonDivs = document.querySelectorAll('div[dusk*="pokemon-"]');
const need = [];
pokemonDivs.forEach(div => {
const badgeContainer = div.querySelector('div.absolute');
const isCaught = badgeContainer ? !!badgeContainer.querySelector('caught-badge') : false;
if (isCaught) return;
const dusk = div.getAttribute("dusk");
const match = dusk?.match(/pokemon-(\d+)/);
if (match) need.push(parseInt(match[1],10));
});
if (!need.length){ alert("No missing Pokémon found."); return; }
need.sort((a,b)=>a-b);
const searchString = collectionPrefix + need.join(",");
const blob = new Blob([searchString], {type:"text/plain"});
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "pokemon_go_search.txt";
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
alert(`✅ Found ${need.length} missing Pokémon.\nSaved with collection prefix: "${collectionPrefix}"`);
})();
@gandanimal
Copy link
Author

gandanimal commented Nov 2, 2025

Script that generates search string for missing pokemon from the Godex website

IT'S A BOOMARKLET, just add to bookmarks and run it inside Godex in the collection of your choosing. If you want to run it in console just remove the first and last line.

It also adds the collection type to the search string!

With a few exceptions that make sense given that, i'm assuming, this is made to get a trade list so non tradable pokemon shouldn't be included. Here's the exceptions:

Shadow - won't add anything to the string since shadow can't be traded
Lucky - won't add anything to the string since lucky pokemon are non tradable and you need the normal version regardless
Mega - won't add anything to the string traded megas can't be mega evolved without energy so again it ignores and doesn't add anything
Gender - won't add anything to the string This is just because it's a lot more complicated to add to teh script, might do it later)

Cases it does work with:

Event - will add costume&
Dmax - will add dynamax&
Gmax - will add gigantamax&
Shiny - will add shiny& (works with any type of shiny combination (except shadow mega and lucky ofc), so event shiny will be shiny&costume, dynamax shiny willbe shiny&dynamax and so on)
Purified - will add shadow,purified& (included shadow here since you can purifiy them to later trade, also included in shiny and purified collection)

Possible improvements in the future:

  1. Include gender

EDIT: It now works in every mode by using a different method to search for pokemon. It also works in shadow collections but doesn't add anything

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