Page MenuHomePhabricator

Create a gadget that displays the Wikidata ID of a page near the title
Closed, ResolvedPublic

Description

The Wikidata ID can be obtained from this API call which returns a JSON like this:

{
   "batchcomplete": "",
   "query": {
       "pages": {
           "15580374": {
               "pageid": 15580374,
               "ns": 0,
               "title": "Main Page",
               "pageprops": {
                   "noeditsection": "",
                   "noexternallanglinks": "a:1:{i:0;s:1:\"*\";}",
                   "notoc": "",
                   "page_image": "Halebopp031197.jpg",
                   "wikibase_item": "Q5296"
               }
           }
       }
   }
}

You need to extract the "wikibase_item" property and display the value (Q5296 in this example) next to the title. The default styling should be similar to the one at Wikidata, but the gadget should allow linking to the actual Wikidata item by setting a variable in JS.

Event Timeline

Strainu created this task.Oct 18 2016, 10:59 PM
Restricted Application added subscribers: TerraCodes, Aklapper. · View Herald TranscriptOct 18 2016, 10:59 PM
Strainu added a comment.EditedOct 18 2016, 11:00 PM

I will mentor this in Google-Code-In-2016

Victorbarbu added a subscriber: Victorbarbu.

Not a mentor, but still wanna do this if that's ok!

Hi Victor,

If you intend to participate in Google Code-in 2016, I believe you will still need to claim the corresponding task on the platform in order to get credit for your work. That will only be possible after Nov 28th, when the contest begins.

I know that, thank you. I will claim it when the contest begins!

Base added a subscriber: Base.Dec 21 2016, 11:40 PM

Aren't there several such gadgets available already?

Are the ones I know, I am pretty sure there must be some other similar too.