Talk:2024 World Athletics Indoor Tour

Script to generate meetings table
This is the script I used to generate the meetings table (note that the API key is public):

const meets = await (await fetch("https://wpgiegzkbrhj5mlsdxnipboepm.appsync-api.eu-west-1.amazonaws.com/graphql", { "credentials": "omit", "headers": { "x-api-key": "da2-juounigq4vhkvg5ac47mezxqge", },   "body": JSON.stringify({	"operationName": "getMinisiteCalendarEvents",	"query": `query getMinisiteCalendarEvents($competitionGroupId: Int, $competitionSubgroupId: Int, $season: String) {  getMinisiteCalendarEvents(competitionGroupId: $competitionGroupId, competitionSubgroupId: $competitionSubgroupId, season: $season) {    options {      seasons {        id        name        __typename      }      competitionSubgroups {        id        name        count        __typename      }      __typename    }    parameters {      season      competitionGroupId      competitionSubgroupId      __typename    }    results {      id      iaafId      hasResults      hasStartlist      hasApiResults      disciplines      rankingCategory      competitionSubgroup      undeterminedCompetitionPeriod {        status        label        remark        __typename      }      name      venue      country startDate endDate dateRange __typename }   __typename } }`,	"variables": { "competitionGroupId": 3677, "competitionSubgroupId": 0, "season": "2023/24" }   }),    "method": "POST", })).json; console.log(['Gold', 'Silver', 'Bronze', 'Challenger'].map(tier => {  const mtgs = meets.data.getMinisiteCalendarEvents.results.filter(m => m.competitionSubgroup === tier);  return `| colspan="4" align="center" bgcolor="${tier === 'Challenger' ? 'white' : tier.toLowerCase}" | ${tier} Level Meetings (${mtgs.length}) \n|-\n` + mtgs.map(m => { const words = m.name.split(' ').filter((w, i) => {   if (+w === new Date(m.startDate).getFullYear) return false;    if (i === 0 && w.match(/^[0-9]+(st|nd|rd|th)$/)) return false;    return true;  }); if (words.join(' ') === 'Meeting de Paris') words.push('Indoor'); const name = words.join(' '); return `| ${m.startDate} || ${['Gold', 'Silver'].includes(tier) ? `${name}` : name} || ${m.venue.split(', ').slice(1).join(', ')} || ` }).join('\n|-\n') }).join('\n|-\n'));

--Habst (talk) 19:18, 25 October 2023 (UTC)