Fast Navigation for Pokemon #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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;
This could perhaps be done with an exact-match of the pokemon's name => id and 304.
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/vaporeonfor 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 abeforestatement and make it run before every route, I'll have to see if that works.This works now!
https://theriodex.net/en/show/pokemon/moves/vaporeon/gen/5works just fine and also has fuzzy-matching included now also. So if you go tohttps://theriodex.net/en/show/pokemon/moves/vaaapooreeeooonn/gen/5it'll still work! >:3 All languages are matched so that even something likehttps://theriodex.net/en/show/pokemon/moves/Aquana/gen/5(the German name for Vaporeon) works fine.Thank you for the idea @cosmic, I think I'll close this for now!