User:Habst/gbrTable.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Habst/gbrTable. |
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);