Last active
November 28, 2024 06:11
-
-
Save willnet/a1def22d1946de09d0d957528eca230c to your computer and use it in GitHub Desktop.
google meet参加者から誰か一人をランダムで選択するスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// chromeを利用して、ユーザ一覧を表示しつつconsoleで↓を実行すると、現在の参加者からランダムで一人表示することができます | |
const names_array = document.querySelector("[aria-label='参加者']").innerText.split("\n").filter((word)=> !word.match(/\(|メイン|ミュート|主催者|画面共有|その他の操作|keep_off|more_vert|keep|domain_disabled/)) | |
const names_set = new Set(names_array) | |
const names_uniq_array = Array.from(names_set) | |
names_uniq_array[Math.floor(Math.random() * names_uniq_array.length)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// chromeを利用して、ユーザ一覧を表示しつつconsoleで↓を実行すると、現在の参加者をシャッフルして表示できます | |
const names_array = document.querySelector("[aria-label='参加者']").innerText.split("\n").filter((word)=> !word.match(/\(|メイン|ミュート|主催者|画面共有|その他の操作|keep_off|more_vert|keep|domain_disabled/)) | |
const names_set = new Set(names_array) | |
const array = Array.from(names_set) | |
for (let i = array.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[array[i], array[j]] = [array[j], array[i]]; | |
} | |
array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
shuffle_from_attendees
をちょっとだけ加工したらbookmarkletで動きました!ありがとうございます!