Jump to content

User:Habst/getNCAA17.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.
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')
*/