Last active
April 4, 2024 23:27
-
-
Save lamchau/9a9eb83bbf6f8a08bfd23eac51469540 to your computer and use it in GitHub Desktop.
capture messages from google meet chat log (as a JSON blob)
This file contains 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
(() => { | |
const CURRENT_USER_NAME = document.querySelector('.dwSJ2e'); | |
const $messages = Array.from(document.querySelectorAll('.Ss4fHf')); | |
const messages = $messages | |
.map($element => { | |
const time = $element.querySelector('.MuzmKe').innerText; | |
const author = $element.querySelector('.poVWob').innerText; | |
const lines = Array.from($element.querySelectorAll('.ptNLrf')).map(x => x.innerText); | |
// duplicate fields rapid successive messages for easier formatting | |
return lines.map(message => ({ | |
time, | |
author: author == 'You' ? CURRENT_USER_NAME : author, | |
message, | |
})); | |
}) | |
.flat(); | |
// console only API to copy to clipboard | |
copy(messages); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment