Jump to content

User:Habst/makeUsaNationalsMeet.js

From Wikipedia, the free encyclopedia
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.
// <nowiki>
year = '1922';
window.doc ??= new DOMParser().parseFromString(await (await fetch('https://en.wikipedia.org/wiki/USA_Outdoor_Track_and_Field_Championships')).text(), 'text/html');
tr = [...doc.querySelectorAll('tr')].find(tr => tr.querySelector('td')?.innerText === year);
([_, mLoc, mStadium, mDate, wLoc, wStadium, wDate] = [...tr.querySelectorAll('td')].map(td => td?.innerText));
([mMonth, mDays] = mDate.split(' ').map(s => s.replace(',', '')));
([wMonth, wDays] = wDate?.split(' ')?.map(s => s.replace(',', '')) ?? []);
([mCity, mState] = mLoc.split(', '));
([wCity, wState] = wLoc?.split(', ') ?? []);

`{{short description|American athletics championship event}}
{{Use dmy dates|date=December 2024}}
{{Infobox Athletics Championships
| Name = ${year} USA Outdoor Track and Field Championships
| Stadium image = [[File:.jpg|200px]]
| Size = 
| Host city = [[${mCity}, ${mState}]] (men)
<br>[[${wCity}, ${wState}]] (women)
| Dates = ${mDays} ${mMonth} (men)
<br>${wDays} ${wMonth} (women)
| Stadium = [[${mStadium}]] (men)
<br>[[${wStadium}]] (women)
| Athletes participating = 
| Events = 
| Previous = [[${year-1} USA Outdoor Track and Field Championships|${year-1}]]
| Next = [[${+year+1} USA Outdoor Track and Field Championships|${+year+1}]]
}}
The ${year} [[USA Outdoor Track and Field Championships]] were organized by the [[Amateur Athletic Union]] (AAU) and served as the [[national championships]] in outdoor [[track and field]] for the [[United States]].

The men's edition was held at [[${mStadium}]] in [[${mCity}, ${mState}]], and it took place ${mDays} ${mMonth}. ${wLoc ? `The women's meet was held separately at [[${wStadium}]] in [[${wCity}, ${wState}]], on ${wDays} ${wMonth}.` : "The first women's championships were not held until [[1923 USA Outdoor Track and Field Championships|1923]].<ref>{{cite web |title=Sites & Dates Of The U.S. National Women’s Championships |url=https://trackandfieldnews.com/sites-dates-of-the-national-womens-championships/ |website=[[Track & Field News]] |access-date=4 December 2024}}</ref>"}

At the ${wLoc ? "men's " : ''}championships, .<ref>{{cite web |title=Sites/Dates Of The U.S. Men’s Nationals, 1876–2023 |url=https://trackandfieldnews.com/sites-of-the-national-mens-championships/ |website=[[Track & Field News]] |access-date=4 December 2024 |date=19 October 2020}}</ref>${wLoc ? ` In the women's competition, .<ref>{{cite web |title=Sites & Dates Of The U.S. National Women’s Championships |url=https://trackandfieldnews.com/sites-dates-of-the-national-womens-championships/ |website=[[Track & Field News]] |access-date=4 December 2024}}</ref>` : ''}

==Results==

${(wLoc ? ['===Men===\n', '===Women===\n'] : ['']).map(h => `${h}{| {{MedalistTable|type=Event|columns=2}}
|-

|}`)}

==See also==
* [[${year} USA Indoor Track and Field Championships]]
* [[List of USA Outdoor Track and Field Championships winners (men)]]
* [[List of USA Outdoor Track and Field Championships winners (women)]]

==References==
{{Reflist|refs=
<ref name=usatf>{{cite web |title=USATF Outdoor Champions |website=[[USA Track & Field]] |url=https://www.usatf.org/resources/statistics/usatf-champions/usatf-outdoor-champions |access-date=4 December 2024}}</ref>
<ref name=ap>{{apch|usa-track-and-field-championships/${year}-usa-track-and-field-championships}}</ref>
}}
; Results
* {{cite web |title=U.S. National Championships History 1876–2023: Results by Event |url=https://trackandfieldnews.com/u-s-national-championships-history/ |website=[[Track & Field News]] |access-date=4 December 2024}}
* {{cite web |title=Track and Field Statistics: USA National Championship ${year} Men, Track |url=http://trackfield.brinkster.net/USATournaments.asp?TourCode=N&Year=${year}&Gender=M&TF=T&P=F&By=Y&Count= |website=trackfield.brinkster.net |access-date=4 December 2024}}
* {{cite web |title=Track and Field Statistics: USA National Championship ${year} Men, Field |url=http://trackfield.brinkster.net/USATournaments.asp?TourCode=N&Year=${year}&Gender=M&TF=F&P=F&By=Y&Count= |website=trackfield.brinkster.net |access-date=4 December 2024}}${wLoc ? `
* {{cite web |title=Track and Field Statistics: USA National Championship ${year} Women, Track |url=http://trackfield.brinkster.net/USATournaments.asp?TourCode=N&Year=${year}&Gender=W&TF=T&P=F&By=Y&Count= |website=trackfield.brinkster.net |access-date=4 December 2024}}
* {{cite web |title=Track and Field Statistics: USA National Championship ${year} Women, Field |url=http://trackfield.brinkster.net/USATournaments.asp?TourCode=N&Year=${year}&Gender=W&TF=F&P=F&By=Y&Count= |website=trackfield.brinkster.net |access-date=4 December 2024}}` : ''}

{{USA Outdoor Track and Field Championships}}

${`
[[Category:USA Outdoor Track and Field Championships]]
[[Category:${year} in athletics (track and field)|USA Outdoor Track And Field Championships, ${year}]]
[[Category:${year} in sports in ${mState}|USA Outdoor Track and Field Championships]]
[[Category:${year} in sports in ${wState}|USA Outdoor Track and Field Championships]]
[[Category:${mMonth} ${year} sports events in the United States|USA Outdoor Track and Field Championships]]
[[Category:${wMonth} ${year} sports events in the United States|USA Outdoor Track and Field Championships]]
[[Category:Track and field competitions in ${mState}]]
[[Category:Track and field competitions in ${wState}]]
[[Category:Sports competitions in ${mCity}, ${mState}]]
[[Category:Sports competitions in ${wCity}, ${wState}]]
[[Category:${year} in sports in ${mCity}, ${mState}]]
[[Category:${year} in sports in ${wCity}, ${wState}]]
${wLoc ? `[[Category:Women's sports in ${wState}]]
[[Category:${year} in American women's sports]]
[[Category:${year} in women's athletics]]` : ''}
`.split('\n').filter(x => x).reduce((acc, x) => acc.includes(x) ? acc : [...acc, x], []).join('\n')}
`.split('\n').filter(x => !x.includes('undefined')).join('\n')
// </nowiki>