The basic idea is to provide stable urls that show a Wikidata item's sitelinks in a single language. Possibly also showing related items, e.g. items found from "What links here" and/or items with nearby coordinates. If combined with a tool to generate QR codes for the stable urls, this would be a solution to https://meta.wikimedia.org/wiki/2017_Community_Wishlist_Survey/Wikidata/Qr_codes_for_all_items
This tool is located on the Wikimedia Toolforge, at https://tools.wmflabs.org/portal/. To update:
- Login with to toolforge with ssh:
$
ssh -i ~/.ssh/id_rsa user@login.tools.wmflabs.org
- Become the tool account:
$
become portal
- Pull from GitHub repo into the
public_html
folder:$
cd public_html
$
git pull
- If the
.lighttpd.conf
file has changed, that file needs to be copied to the root directory:$
cp public_html/.lighttpd.conf .lighttpd.conf
- Restart the webservice:
$
webservice stop
$
webservice start
The stable url format is {base-url}/portal/{item}/{lang-code}
(e.g. {base-url}/portal/Q12345/en)
with /{lang-code}
being optional.
This maps to {base-url}/portal/index.php?id={item}&lang={lang-code}
(via the url rewrite rules in .lighttpd.conf
file).
Item titles, descriptions, and sitelinks are retrieved from the Wikidata api.
I18n: labels and descriptions from Wikidata are already in the correct langauge. Other strings are pulled from json files. If the language is not specified, the device language is detected.
Mock output for Q1129708/en:
- Encycylopedia article
Wikipedia - Travel guide
Wikivoyage - Multimedia
Wikimedia Commons - Data
Reasonator
- Ernest Giles
explorer - Mount Mine
mine in Coolgardie, Western Australia - Pascal Garnier
French engineer
- Cremorne Theatre and Gardens
former cinema in Coolgardie, Western Australia, Australia - Coolgardie Town Hall and Gardens
former cinema in Coolgardie, Western Australia, Australia