Jump to content

Wikipedia talk:WikiProject Medicine/Stats/Top medical editors 2017 (all)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Generating list

[edit]

Description in more or less human-readable language (will try to improve it later). How I did it.

  1. Run a SQL query to get all enwiki articles (and their Wikidata item), that are part of Wikiproject Medicine (gladfully we have a category, so no "overload" with querying with template)
  2. From the results, grab all WD items and do API query (I do them in batches of 500 items) to get all sitelinks
  3. Make a dictionary/array/list/JSON or whatever it's called in your preferred language in such form:
    {'enwiki':['enwiki article 1','enwiki article 2',...],'frwiki':['frwiki article 1',...],...}
  4. Wiki by wiki do a SQL for articles (I made it by batches of 100 articles), first selecting page ids from page titles (don't forget about underscores :) ), and then get user edit history of 2017. And then simply group by the results in form that you prefer.
  5. Basically that's it :)

--Edgars2007 (talk/contribs) 06:27, 25 April 2018 (UTC)[reply]