Wednesday, April 23, 2014

#Wikidata - More 2014 deaths

When you are interested what notable people died in 2014, you will find that Wikidata is more complete than any Wikipedia. The ToolScript tool provides a wonderful opportunity to add even more people to this list.

Sadly for many people recognition at being notable is left for the moment when they die. Then again, it is a perfect moment to write a Wikipedia article as an obituary. Magnus wrote yet another script that creates an item for the articles that did not have one yet.

This is the script that finds all the items that are in need of some attention..
all_items = ts.getNewList('','wikidata');
cat = ts.getNewList('it','wikipedia').addPage('Category:Morti nel 2014').getWikidataItems().loadWikidataInfo();
$.each ( cat.pages[0].wd.sitelinks , function ( site , sitelink ) {
  var s = ts.getNewList(site).addPage(sitelink.title); // Page list for that site, with category
  if ( s.pages[0].page_namespace != 14 ) return ; // Not a category
  var items = ts.categorytree({language:s.language,project:s.project,root:s.pages[0].page_title,redirects:'none'}).getWikidataItems().hasProperty("P570",false);
  all_items = all_items.join(items);
} )
all_items.show();
Yes, ToolScript comes with documentation :)
Thanks,
    GerardM

No comments: