Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 3.21 KB

README.md

File metadata and controls

54 lines (45 loc) · 3.21 KB

wm-portal

The free knowledge portal.

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

Updating

This tool is located on the Wikimedia Toolforge, at https://tools.wmflabs.org/portal/. To update:

  1. Login with to toolforge with ssh:

    $ ssh -i ~/.ssh/id_rsa user@login.tools.wmflabs.org

  2. Become the tool account:

    $ become portal

  3. Pull from GitHub repo into the public_html folder:

    $ cd public_html

    $ git pull

  4. If the .lighttpd.conf file has changed, that file needs to be copied to the root directory:

    $ cp public_html/.lighttpd.conf .lighttpd.conf

  5. Restart the webservice:

    $ webservice stop

    $ webservice start

Notes

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:

Coolgardie

town in Western Australia

Related:
Nearby:
Free knowledge portal -- [CC0 logo] CC0 -- data available on Wikidata