User:Habst/getNCAA17.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/getNCAA17. |
ds = {
Georgetown:'Georgetown University',
Gonzaga:'Gonzaga University',
Furman:'Furman University',
Portland:'University of Portland',
'SE Louisiana': 'Southeastern Louisiana University',
Georgia: 'University of Georgia',
'Sam Houston St.': 'Sam Houston State University',
Missouri: 'University of Missouri',
Kentucky: 'University of Kentucky',
Nebraska: 'University of Nebraska–Lincoln',
Oregon: 'University of Oregon',
Alabama: 'University of Alabama',
'N. Dakota St.': 'North Dakota State University',
Memphis: 'University of Memphis',
Albany: 'University of Albany',
'William and Mary': 'College of William & Mary',
Akron:'University of Akron',
Cincinnati:'University of Cincinnati',
Kansas:'University of Kansas',
'South Dakota':'University of South Dakota',
'South Alabama':'University of South Alabama',
'Notre Dame':'University of Notre Dame',
Texas:'University of Texas at Austin',
Penn:'University of Pennsylvania',
Oklahoma:'University of Oklahoma',
Duke:'Duke University',
Wisconsin:'University of Wisconsin–Madison',
'South Carolina':'University of South Carolina',
'Princeton':'Princeton University',
'Stephen F. Austin':'Stephen F. Austin State University',
Arizona:'University of Arizona',
Louisville:'University of Louisville',
Florida:'University of Florida',
Illinois:'University of Illinois Urbana-Champaign',
'Long Beach St.':'California State University, Long Beach',
Samford:'Samford University',
Arkansas:'University of Arkansas',
Wyoming:'University of Wyoming',
TCU:'Texas Christian University',
Baylor:'Baylor University',
USC:'University of Southern California',
Virginia:'University of Virginia',
'Oral Roberts':'Oral Roberts University',
Iowa:'University of Iowa',
Indiana:'Indiana University Bloomington',
'N. Carolina A&T':'North Carolina A&T State University',
Clemson:'Clemson University',
UTSA:'University of Texas at San Antonio',
'Sacramento St.':'Sacramento State University',
Michigan:'University of Michigan',
Minnesota:'University of Minnesota',
Rice:'Rice University',
Houston: 'University of Houston',
};
/* for decathlon only
[...document.querySelectorAll('tr.norm, tr.alt')].map(tr => {
let [pl, _, nameschool, mark] = [...tr.querySelectorAll('td')].map(td => td.innerText);
mark=mark.split('\n')[0]
let[name,school]=nameschool.split('\n')
school=school.split(' ').slice(0,-1).join(' ')
school=school[0].toUpperCase()+school.slice(1)
let [fn, ln] = name.split(' ');
ln = ln[0] + ln.slice(1).toLowerCase()
return `| ${{1:'{{Gold1}}',2:'{{Silver2}}',3:'{{Bronze3}}'}[pl] ?? pl} || align=left| [[${fn} ${ln}]] ||align=left| [[${ds[school] ?? school}]] || ${mark} ||`
}).join('\n|-\n')
*/
/* field events with wind
[...document.querySelectorAll('tr.normal, tr.alt')].map(tr => {
const [pl, _, name, _2, school, mark, _3, wind] = [...tr.querySelectorAll('td')].map(td => td.innerText);
let [fn, ln] = name.split(' ');
ln = ln[0] + ln.slice(1).toLowerCase()
return `| ${{1:'{{Gold1}}',2:'{{Silver2}}',3:'{{Bronze3}}'}[pl] ?? pl} || align=left| [[${fn} ${ln}]] ||align=left| [[${ds[school] ?? school}]] || ${mark} || ${wind} ||`
}).join('\n|-\n')
*/
/* 2021 field events */
[...document.querySelectorAll('#events tbody tr')].map(tr => {
let [pl, _, nameschool, mark, _2, wind] = [...tr.querySelectorAll('td')].map(td => td.innerText);
mark=mark.split('\n')[0]
let[name,school]=nameschool.split('\n')
school=school.split(' ').slice(0,-1).join(' ')
school=school[0].toUpperCase()+school.slice(1)
let [fn, ln] = name.split(' ');
ln = ln[0] + ln.slice(1).toLowerCase()
return `| ${{1:'{{Gold1}}',2:'{{Silver2}}',3:'{{Bronze3}}'}[pl] ?? pl} || align=left| [[${fn} ${ln}]] ||align=left| [[${ds[school] ?? school}]] || ${mark} || ${wind} ||`
}).join('\n|-\n')
/*
[...document.querySelectorAll('tr.normal, tr.alt')].map(tr => {
const [pl, _, name, _2, school, mark] = [...tr.querySelectorAll('td')].map(td => td.innerText);
let [fn, ln] = name.split(' ');
ln = ln[0] + ln.slice(1).toLowerCase()
return `| ${{1:'{{Gold1}}',2:'{{Silver2}}',3:'{{Bronze3}}'}[pl] ?? pl} || align=left| [[${fn} ${ln}]] ||align=left| [[${ds[school] ?? school}]] || ${mark} ||`
}).join('\n|-\n')
*/