Last active
August 29, 2024 17:04
-
-
Save TravisL12/217a2e832cecb5c9f4af906427173855 to your computer and use it in GitHub Desktop.
Various chrome snippets
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
// when viewing a zoom recording on the web you can use this to export the transcripts | |
function scrape(htmlContent) { | |
const transcriptItems = htmlContent.querySelectorAll('.transcript-list-item'); | |
const chatArray = Array.from(transcriptItems).reduce((acc,item)=>{ | |
const user = item.querySelector('.user-profile-info')?.textContent.trim(); | |
const timestamp = item.querySelector('.time')?.textContent.trim(); | |
const chat = item.querySelector('.text')?.textContent.trim(); | |
const currentChat = acc[acc.length - 1]; | |
let thing = { | |
user: undefined, | |
timestamp: undefined, | |
chatList: [], | |
chats: '' | |
} | |
if (user) { | |
thing.user = user; | |
thing.timestamp = timestamp | |
thing.chatList.push(chat || '') | |
// thing.chats += (`${chat}\n` || "") | |
acc.push(thing); | |
} else { | |
currentChat.chatList.push(chat || '') | |
// currentChat.chats += (`${chat}\n` || "") | |
} | |
return acc; | |
} | |
, []); | |
return chatArray; | |
} | |
// const content = document.querySelector('ul[aria-label="Audio Transcript List"]') | |
// scrape(content); |
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
// use this to increase the speed of video/audio elements automatically. This is really great when watching mandatory training videos at work and you can't skip ahead. | |
function increaseSpeed(rate=10) { | |
const vids = document.querySelectorAll('video') | |
const sounds = document.querySelectorAll('audio') | |
if (sounds && sounds.length > 0) { | |
sounds.forEach(sound=>{ | |
sound.playbackRate = rate | |
} | |
) | |
} | |
if (vids && vids.length > 0) { | |
vids.forEach(vid=>{ | |
vid.playbackRate = rate | |
} | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment