From 1fa7384ef0835dfe9448543f34cb4e3f3672335a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 17 Dec 2024 13:14:01 -0800 Subject: [PATCH] Update contributors. --- spec/common/README.md | 2 +- spec/common/participants.html | 45 ++++++++++++++++++++++++++++++++++- spec/common/participants.js | 32 ++++++++++++++----------- 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/spec/common/README.md b/spec/common/README.md index 4efc497..d22d196 100644 --- a/spec/common/README.md +++ b/spec/common/README.md @@ -5,6 +5,6 @@ This repository is meant to be used as a submodule in multiple repository holdin ## Retrieving group participants -The `participants.js` Node script can be used to retrieve the list of working group participants. It requires an API Key. +The `participants.js` Node script can be used to retrieve the list of working group participants. It takes an optional API Key (use empty string to omit). node participants.js wg/rdf-star > participants.html diff --git a/spec/common/participants.html b/spec/common/participants.html index fe5a8a6..53af916 100644 --- a/spec/common/participants.html +++ b/spec/common/participants.html @@ -1 +1,44 @@ -Members of the RDF-star Working Group Group included Achille Zappa, Adrian Gschwend, Andy Seaborne, Antoine Zimmermann, Dan Brickley, David Chaves-Fraga, Dominik Tomaszuk, Dörthe Arndt, Enrico Franconi, Fabien Gandon, Gregg Kellogg, Gregory Williams, Jesse Wright, Jose Emilio Labra Gayo, Julián Arenas-Guerrero, Olaf Hartig, Ora Lassila, Pasquale Lisena, Peter Patel-Schneider, Pierre-Antoine Champin, Raphaël Troncy, Ruben Taelman, Rémi Ceres, Souripriya Das, Stuart Sutton, Ted Thibodeau, Thomas Pellissier Tanon, Timothée Haudebourg, and Vladimir Alexiev. +Members of the RDF-star Working Group Group included + Vladimir Alexiev, + Amin Anjomshoaa, + Julián Arenas-Guerrero, + Dörthe Arndt, + Bilal Ben Mahria, + Erich Bremer, + Kurt Cagle, + Rémi Ceres, +Pierre-Antoine Champin, + Souripriya Das, + Daniil Dobriy, + Enrico Franconi, + Jeffrey Phillips Freeman, + Fabien Gandon, + Benjamin Goering, + Adrian Gschwend, + Olaf Hartig, + Timothée Haudebourg, + Ian Horrocks, + Gregg Kellogg, + Mark Kim, + Jose Emilio Labra Gayo, + Ora Lassila, + Richard Lea, + Niklas Lindström, + Pasquale Lisena, + Thomas Lörtsch, + Matthew Nguyen, + Peter Patel-Schneider, + Thomas Pellissier Tanon, + Dave Raggett, + Jean-Yves ROSSI, + Felix Sasaki, + Andy Seaborne, + Ruben Taelman, + Ted Thibodeau Jr, + Dominik Tomaszuk, + Raphaël Troncy, + William Van Woensel, + Gregory Williams, + Jesse Wright, + Achille Zappa, and + Antoine Zimmermann. diff --git a/spec/common/participants.js b/spec/common/participants.js index 42d7c1e..6d27145 100644 --- a/spec/common/participants.js +++ b/spec/common/participants.js @@ -10,17 +10,14 @@ const https = require('https'); const process = require('process'); -const APIKEY = process.env.APIKEY || process.argv[2]; +const APIKEY = process.env.APIKEY || process.argv[2] || ''; const GROUP = process.env.GROUP || process.argv[3] || "wg/rdf-star"; -if (!APIKEY) { - console.error('Error: APIKEY must be specified as either an environment variable or a command-line argument.'); - process.exit(1); -} +var apikey = APIKEY.length > 0 ? `&apikey=${APIKEY}` : '' const groupOptions = { hostname: 'api.w3.org', - path: `/groups/${GROUP}?items=50&apikey=${APIKEY}`, + path: `/groups/${GROUP}?items=50${apikey}`, headers: { 'Accept': 'application/json' } @@ -28,7 +25,7 @@ const groupOptions = { const userOptions = { hostname: 'api.w3.org', - path: `/groups/${GROUP}/users?items=50&apikey=${APIKEY}`, + path: `/groups/${GROUP}/users?items=50${apikey}`, headers: { 'Accept': 'application/json' } @@ -53,16 +50,23 @@ https.get(groupOptions, (res) => { res.on('end', () => { const users = JSON.parse(userData)._links.users.map(u => u.title); - const sortedUsers = users.sort(); - if (sortedUsers.length === 1) { - console.log(`The sole member of the ${groupName} Group was ${sortedUsers[0]}.`); - } else if (sortedUsers.length === 2) { - const joinedUsers = sortedUsers.join(' and '); + if (users.length === 1) { + console.log(`The sole member of the ${groupName} Group was ${users[0]}.`); + } else if (users.length === 2) { + const joinedUsers = users.join(' and '); console.log(`Members of the ${groupName} Group included ${joinedUsers}.`); } else { - const joinedUsers = sortedUsers.slice(0, -1).join(', '); - console.log(`Members of the ${groupName} Group included ${joinedUsers}, and ${sortedUsers[sortedUsers.length - 1]}.`); + // Find the maximum length of the first part (before the space) + const maxLength = Math.max(...users.map(user => user.split(" ")[0].length)); + + // Right-align the first component and format the strings + const alignedUsers = users.map(user => { + const [first, ...rest] = user.split(" "); + return first.padStart(maxLength, " ") + " " + rest.join(" "); + }); + const joinedUsers = alignedUsers.slice(0, -1).join(",\n"); + console.log(`Members of the ${groupName} Group included\n${joinedUsers}, and\n${alignedUsers[users.length - 1]}.`); } }); }).on('error', (err) => {