From 9289cd1450140d18d981420a99ae1528eb98614c Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 11 May 2026 15:22:53 +0100 Subject: [PATCH] Add README.md Co-Authored-By: Claude Sonnet 4.6 --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..73cb212 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# Missing Link + +A Wikipedia tool that finds articles which mention a topic by name but don't +link to it, then lets you add the missing wikilink directly from your browser. + +Live at: https://edwardbetts.com/missinglink/ + +## How it works + +1. Enter a Wikipedia article title. +2. The tool searches Wikipedia for articles that mention the title but don't + include a wikilink to it. +3. For each candidate, a diff shows the proposed edit in context. +4. Save the edit to Wikipedia with one click (requires a Wikipedia account), + or skip to the next candidate. + +Redirect targets are handled automatically — if the title is a redirect, +the tool produces a piped link (e.g. `[[Possession of stolen goods|handling stolen goods]]`) +and excludes articles that already link to the redirect target. + +## Setup + +### Dependencies + +``` +pip install flask requests requests-oauthlib simplejson flipflop +``` + +### Configuration + +Copy `config/default.py` and add your Wikipedia OAuth credentials: + +```python +SECRET_KEY = 'your-flask-secret-key' +CLIENT_KEY = 'your-oauth-consumer-key' +CLIENT_SECRET = 'your-oauth-consumer-secret' +``` + +Register an OAuth 1.0a consumer at +https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose + +### Running locally + +``` +python web_view.py +``` + +The app listens on `http://0.0.0.0:8000`. + +### Running under Apache mod_fcgid + +The `run.fcgi` entry point is used by Apache. Touch it to reload the app +after code changes: + +``` +touch run.fcgi +``` + +## Project layout + +``` +web_view.py Flask application and routes +add_links/ + api.py Wikipedia API client (read, search, diff) + match.py Link-finding and wikitext editing logic + core.py Search and candidate ranking + mediawiki_oauth.py OAuth session management + mediawiki_api.py Authenticated write API calls +templates/ Jinja2 HTML templates +static/ CSS and assets +```