Skip to content

Instantly share code, notes, and snippets.

@lamchau
Last active April 4, 2024 23:27
Show Gist options
  • Save lamchau/9a9eb83bbf6f8a08bfd23eac51469540 to your computer and use it in GitHub Desktop.
Save lamchau/9a9eb83bbf6f8a08bfd23eac51469540 to your computer and use it in GitHub Desktop.
capture messages from google meet chat log (as a JSON blob)
(() => {
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