Mediawiki as Link Shortening Database
| MediaWiki Users and Developers Conference Fall 2025 | |
|---|---|
| Mediawiki as Link Shortening Database (online) | |
| Talk details | |
| Description: | We explore the use of a wiki page combined with a barebones MediaWiki extension for community management of "short links"/"go links" |
| Speaker(s): | Audiodude |
| Type: | Lightning talk |
| Audience: | Developers, Community, Admins |
| Event start: | 2025/10/30 10:15:00 |
| Event finish: | 2025/10/30 10:30:00 |
| Length: | 15 minutes |
| Video: | click here |
| Keywords: | database, extension, links |
| Give feedback | |
The Noisebridge hackerspace community in San Francisco was in need of link shortening service. Such a service would condense links like https://www.noisebridge.net/wiki/Donate_or_Pay_Dues to https://nb.wtf/donate, for easier use on posters and in print media.
View the final product at: https://nb.wtf
The main feature of the implemented solution is an on-wiki page with a table that contains a short code and a link. The link can be any URL, but preference is given for intrawiki links, so that community members can simply use `Some Page` as the contents of the table row.
There is a web service running at nb.wtf (on a cloud provider free tier) that reads the wiki page and builds a database of links. In fact, the wiki page essentially is the database, which allows for existing user account management and ACL policies to apply to who can create short links
A MediaWiki extension, containing about 10 lines of code, was written that "pings" nb.wtf whenever the nb-wtf wiki page (database) is updated. It simply informs the service that it needs to re-read the database and prepare to serve the short links.
Overall, this solution has allowed us to deploy a link shortening service that is:
1. Tightly coupled with the use of our wiki 2. Easily compatible with existing user authentication and authorization 3. Easy to see and edit what links exist and where they point 4. Near zero maintenance cost