Skip to content

Instantly share code, notes, and snippets.

@fono09
Created February 7, 2022 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fono09/ea16b9c45e6d48d255b642bbf33a5723 to your computer and use it in GitHub Desktop.
Save fono09/ea16b9c45e6d48d255b642bbf33a5723 to your computer and use it in GitHub Desktop.
Join Meet Automatically
(function() {
Array.from(document.querySelectorAll('div[data-call-id]')).map(e => {
return {
'beginTime': new Date(parseInt(e.dataset.beginTime)),
'url': `https://meet.google.com/${e.dataset.callId}`,
}
})
.filter(mtg => mtg.beginTime > Date.now()) // 過去のMTGには入らない
.map(mtg => {
const BeforeOffset = 5 * 60 * 1000 // 5分前には入る
const leaveMillSec = mtg.beginTime - Date.now() - BeforeOffset
setTimeout(
() => {
window.open(mtg.url, '_blank')
},
leaveMillSec
)
const leaveSec = Math.floor(leaveMillSec / 1000)
console.log(`Meet ${mtg.url} will open in new tab after ${leaveSec}`)
})
})();
@fono09
Copy link
Author

fono09 commented Feb 7, 2022

meet.google.comで起動すると便利なはず。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment