Jump to content

User:Habst/gbrTable.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Habst (talk | contribs) at 00:46, 11 August 2024 (Created page with 'YEAR = 2006; DATE = 'February 24–26'; art = `{{Infobox Athletics Championships | Name = __YEAR__ USA Indoor Track and Field Championships | Colour = #A9F5A9 | Logo = | Size = <!-- do not add "px" --> | Host city = Boston, Massachusetts, United States | Dates = __DATE__ | Stadium = Reggie Lewis Track and Athletic Center | Stadium image = 200px | Level = Senior | Type = Indoor | Athletes participating = | Events = 28...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
YEAR = 2006;
DATE = 'February 24–26';
art = `{{Infobox Athletics Championships
| Name = __YEAR__ USA Indoor Track and Field Championships
| Colour = #A9F5A9
| Logo =
| Size = <!-- do not add "px" -->
| Host city = [[Boston, Massachusetts]], United States
| Dates = __DATE__
| Stadium = [[Reggie Lewis Track and Athletic Center]]
| Stadium image = [[File:Reggie Lewis Center.jpg|200px]]
| Level = Senior
| Type = Indoor
| Athletes participating =
| Events = 28 (14 men's + 14 women's)
| Records set =
| Previous = [[__PREV__ USA Indoor Track and Field Championships|__PREV__]]
| Next = [[__NEXT__ USA Indoor Track and Field Championships|__NEXT__]]
}}
The '''__YEAR__ [[USA Indoor Track and Field Championships]]''' were held at the [[Reggie Lewis Track and Athletic Center]] in [[Boston, Massachusetts]]. Organized by [[USA Track and Field]] (USATF), the two-day competition took place __DATE__ and served as the [[national championships]] in indoor [[track and field]] for the [[United States]].<ref>{{cite web |title=UNITED STATES INDOOR CHAMPIONSHIPS (MEN) |url=http://www.gbrathletics.com/nc/usai.htm |website=GBR Athletics |access-date=9 August 2024}}</ref> The championships in [[combined track and field events]] were held at a different time.<ref>{{cite web |title=2020 & 35th USA Indoor Men's Heptathlon Media Guide |url=https://docslib.org/doc/3075509/2020-usa-i-mens-heptathlon |website=DocsLib |page=9 |access-date=9 August 2024}}</ref><ref>{{cite web|url=https://decathlonusa.typepad.com/files/2014-usatf-i-w-pentathlon.pdf|title=2014 USATF Indoor Women's Pentathlon|page=5|access-date=9 August 2024}}</ref>

At the meeting, 

==Medal summary==
{{clear}}
===Men===
{| {{MedalistTable|columns=2|type=Event}}
|-
__MTBL__
|}

===Women===
{| {{MedalistTable|columns=2|type=Event}}
|-
| [[60 m]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[400 m]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[800 m]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[1500 m]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[3000 m]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[60 m hurdles]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[3000 m walk]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[High jump]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Pole vault]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Long jump]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Triple jump]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Shot put]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Weight throw]]
| [[]] || 
| [[]] || 
| [[]] || 
|-
| [[Indoor pentathlon|Pentathlon]]
| [[]] || 
| [[]] || 
| [[]] || 
|}

==References==
{{reflist}}
; Results
* {{cite web |title=UNITED STATES INDOOR CHAMPIONSHIPS (MEN) |url=http://www.gbrathletics.com/nc/usai.htm |website=GBR Athletics |access-date=9 August 2024}}
* {{cite web |title=2020 & 35th USA Indoor Men's Heptathlon Media Guide |url=https://docslib.org/doc/3075509/2020-usa-i-mens-heptathlon |website=DocsLib |page=9 |access-date=9 August 2024}}
* {{cite web|url=https://decathlonusa.typepad.com/files/2014-usatf-i-w-pentathlon.pdf|website=Decathlon USA|title=2014 USATF Indoor Women's Pentathlon|page=5|access-date=9 August 2024}}

{{USA Indoor Track and Field Championships}}
{{__YEAR__ in athletics}}

{{draft cats|
[[Category:USA Indoor Track and Field Championships|__YEAR__]]
[[Category:February __YEAR__ sports events in the United States]]
[[Category:__YEAR__ in athletics (track and field)|USA Indoor Track and Field Championships]]
[[Category:Sports competitions in Boston]]
[[Category:__YEAR__ in sports in Massachusetts|USA Indoor Track and Field Championships]]
[[Category:Track and field in Massachusetts]]
}}`;
res = {};
tbls = document.querySelectorAll('table[width="886"]');
mTbl = '';
for (const tbl of tbls) {
  const topTrs = tbl.querySelectorAll('tr');
  const evts = topTrs[0].querySelectorAll('td');
  const tds = topTrs[1].querySelectorAll('td');
  const years = tds[0].innerText.split('\n');
  for (let i = 0; i < 3; i++) {
    const gEvt = evts[i * 2 + 1].innerText;
    const evt = gEvt[0] + gEvt.slice(1).toLowerCase().replaceAll('metres', 'm');
    const winners = tds[i * 2 + 1].innerText.split('\n');
    const marks = tds[i * 2 + 2].innerText.split('\n');
    for (let j = 0; j < years.length; j++) {
      const yr = years[j];
      res[yr] ??= {};
      let winner = winners[j];
      if (winner === '-' || !winner?.trim()) continue;
      if (winner.endsWith('&')) winner += ' ' + winners[j + 1];
      res[yr][evt] = [winner, marks[j]];
    }
  }
}
mTbl = Object.entries(res[YEAR]).map(([gEvt, [ath, mark]]) => {
  const evt = gEvt.replace('35 pounds weight', 'Weight throw');
  return `| [[${evt}]]
| [[${ath}]] || ${mark}
|  || 
|  || `;
}).join('\n|-\n');
art.replaceAll('__YEAR__', YEAR).replaceAll('__PREV__', YEAR - 1).replaceAll('__NEXT__', YEAR + 1).replaceAll('__DATE__', DATE).replaceAll('__MTBL__', mTbl);