Skip to content

Conversation

@epidarian
Copy link

@epidarian epidarian commented Feb 11, 2025

I, obviously, could not test this, but it should work.

It first tries the vanilla query, then tries to capitalize all individual words in the query, then it tries to match only the first word in the submitted query. The first time it hits a 200 OK request, it will return content back, and otherwise raise an exception.

Potential issues:

  • in rare cases, an unintended mismatch may occur when a word containing another valid word can be queried, but the full page title cannot be accessed. Currently don't know how to solve for this edge case. Probably not a big deal. Might happen one in a million natural times.

  • There is a slight bit of overhead from assuming that everything is already well-capitalized. Should not cause problems.

Notes:

  • The wiki will 301-redirect the first word in a query. For example, if you enter Alban into the url, it will redirect you to Alban Knights Training Grounds.

@epidarian epidarian marked this pull request as ready for review February 11, 2025 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant