Jump to content

Template talk:FIDE world rankings/women

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

This is an old revision of this page, as edited by Dixtosa (talk | contribs) at 17:58, 23 January 2021 (JS code to generate json). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

JS code to generate json

As of 2021 January this works on here

normalizeName = (name) => name.split(", ")[1] + " " + name.split(", ")[0];
data=$("#div_output tbody tr")
  .map((a, b) => ({
     name:normalizeName($(b).find("td:nth-child(2)").text()),
     rank:$(b).find("td:nth-child(1)").text(),
     rating:$(b).find("td:nth-child(4)").text(),
     country:$(b).find("td:nth-child(3)").text().trim()}))
  .slice(0, 20)
  .toArray();
JSON.stringify(data);

Dixtosa (talk) 17:54, 23 January 2021 (UTC)[reply]