1.9 KiB
1.9 KiB
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
- Enter a Wikipedia article title.
- The tool searches Wikipedia for articles that mention the title but don't include a wikilink to it.
- For each candidate, a diff shows the proposed edit in context.
- 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:
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