da83f0791d
Fix OAuth User-Agent header and improve error handling
...
- Set User-Agent on OAuth1Session during token fetch and access token
exchange so Wikimedia doesn't reject the requests with 403
- Extract handle_post() from article_page() for clarity
- Catch api.MediawikiError in get_best_hit() to skip bad API responses
rather than crashing the page
- Catch mediawiki_api.APIError on save and return a 502 with the error
text instead of a 500 traceback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 18:11:23 +01:00
1be844e57a
Correct spelling mistake
2025-01-16 18:37:07 -06:00
b76a6707f2
Consider all matches, not just exact matches
2023-12-09 18:45:19 +00:00
ba56274022
Tidy code for building list of examples
2023-12-09 18:43:56 +00:00
479dc864fd
Remove debugging output
2023-12-09 18:43:05 +00:00
14d8539298
Link matching improvements
2023-12-09 18:42:53 +00:00
1da620875a
Add type hints and docstrings
2023-12-09 18:42:03 +00:00
113dfd3630
Refactor: new get_hit_count function
2023-12-06 20:58:01 +00:00
98ea589c58
Add more detailed docstring
2023-12-06 20:57:24 +00:00
d76c74395b
Fix name of module
2023-12-06 20:56:59 +00:00
dd9b7be198
Improve article_title_to_search_query function
...
Add more detailed docstring
2023-12-06 20:44:20 +00:00
2c267c67e2
Add types and docstrings
2023-12-06 11:30:34 +00:00
fc0d6f114a
Don't crash when there is no match
2023-12-06 11:30:04 +00:00
ea95c82b37
Rename wikidata_oauth to mediawiki_oauth
2023-12-06 11:29:03 +00:00
128d84fce9
Redirect to oauth_start if not logged in.
2023-12-06 09:53:35 +00:00
39f9ba31ed
Raise LoginNeeded if not logged in
2023-12-06 09:53:06 +00:00
32a7e939a5
Rename article2.html to article.html
2023-11-26 14:13:51 +00:00
6f4ae2537f
Add static/bootstrap to .gitignore
2023-11-26 14:10:00 +00:00
f54401ef05
Show list of hits on article page
2023-11-25 20:59:10 +00:00
8901831568
Adjust OAuth to work better
2023-11-25 19:59:28 +00:00
b6cc79291b
Move article link route to
2023-11-25 19:58:58 +00:00
be4db13179
Adjust favicon 404 route for type hints
2023-11-25 19:58:24 +00:00
99db7df7f1
Add 'type: ignore' for mypy
2023-11-25 19:57:47 +00:00
52f7877bb8
Improve article display
2023-11-25 19:57:04 +00:00
4b73102c22
Move CSS out of template to static file
2023-11-25 19:56:25 +00:00
f07b407e7a
Initial commit
2023-10-04 12:56:21 +01:00