Fast Navigation for Pokemon #1

Closed
opened 2026-07-12 21:49:41 +00:00 by cosmic · 3 comments

It would be nice if it were possible to have pokemon as a name for URLs rather than only using pokemon IDs.

This would permit fast resolution of pages using DDG style !bang commands;

!theriomoves vaporean 5
https://theriodex.net/en/show/pokemon/moves/134/gen/5

This could perhaps be done with an exact-match of the pokemon's name => id and 304.

It would be nice if it were possible to have pokemon as a name for URLs rather than only using pokemon IDs. This would permit fast resolution of pages using DDG style !bang commands; > !theriomoves vaporean 5 > https://theriodex.net/en/show/pokemon/moves/134/gen/5 This could perhaps be done with an exact-match of the pokemon's name => id and 304.
hexaitos added reference dev 2026-07-15 12:27:46 +00:00
Owner

That is a good idea! I wil have to add some sort of pre-wrapper I think that checks whether or not an ID or a Pokémon name was used in the URL. This already does work for just the regular Pokémon (https://theriodex.net/en/show/pokemon/vaporeon for example), so it should not be too hard to add this to the other URLs also!

I did this by doing a if !pokemon_id.is_integer? then pokemon_id = get_pokemon_id_from_name(pokemon_id, language_id) end. I should be able to add this to the other routes also. I could maybe even add this using a before statement and make it run before every route, I'll have to see if that works.

That is a good idea! I wil have to add some sort of pre-wrapper I think that checks whether or not an ID or a Pokémon name was used in the URL. This already *does* work for just the regular Pokémon (`https://theriodex.net/en/show/pokemon/vaporeon` for example), so it should not be too hard to add this to the other URLs also! I did this by doing a `if !pokemon_id.is_integer? then pokemon_id = get_pokemon_id_from_name(pokemon_id, language_id) end`. I should be able to add this to the other routes also. I could maybe even add this using a `before` statement and make it run before *every* route, I'll have to see if that works.
Owner

This works now! https://theriodex.net/en/show/pokemon/moves/vaporeon/gen/5 works just fine and also has fuzzy-matching included now also. So if you go to https://theriodex.net/en/show/pokemon/moves/vaaapooreeeooonn/gen/5 it'll still work! >:3 All languages are matched so that even something like https://theriodex.net/en/show/pokemon/moves/Aquana/gen/5 (the German name for Vaporeon) works fine.

This works now! `https://theriodex.net/en/show/pokemon/moves/vaporeon/gen/5` works just fine and also has fuzzy-matching included now also. So if you go to `https://theriodex.net/en/show/pokemon/moves/vaaapooreeeooonn/gen/5` it'll still work! >:3 All languages are matched so that even something like `https://theriodex.net/en/show/pokemon/moves/Aquana/gen/5` (the German name for Vaporeon) works fine.
Owner

Thank you for the idea @cosmic, I think I'll close this for now!

Thank you for the idea @cosmic, I think I'll close this for now!
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hexaitos/theriodex#1
No description provided.