Wikimedia
Create a gadget that displays the Wikidata ID of a page near the title
Your task is to create a gadget on the Romanian Wikipedia that displays the Wikidata ID of a page near the title, just like it happens on Wikidata.
No knowledge of the language is needed. You will not have the user rights to publish the gadget in the MediaWiki namespace, but you can write it in your userspace and test it by adding it to your personal JS script.
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.
Task tags
Students who completed this task
Tarun Boddupalli