Updated script available at https://www.rushworth.us/lisa/?p=6854 — and, since copy/paste doesn’t seem to work for everyone, the script is also available as a text file.
I had posted a one-liner to grab the text content of the Microsoft Stream transcript — there’s a good bit of cleanup required to make something professional looking, but I’ve been lazy about it & leave formatting up to the recipient. The one-liner approach fails when it doesn’t encounter a text element where it expects to find one. A more robust export approach creates a Node List containing all of the transcript-line classed elements, then iterates through that list and when the node has a textContent attribute appends that content to a running string value. Printing the running string value produces output that needs minimal reformatting.
Code:
var objTranscriptLines = window.document.querySelectorAll('.transcript-line'); var strRunningText = null; for(var i = 0; i < objTranscriptLines.length; i++){ if( objTranscriptLines[i].textContent ){ var strLineText = objTranscriptLines[i].textContent; strRunningText = strRunningText + "\n" + strLineText.replace("Discard Save",""); } } console.log(strRunningText);
Results:
You *could* strip off the timestamps as well — instead of strLineText.replace(“Discard Save”,””) use (strLineText.replace(“Discard Save”,””)).substr(8)
Hi Lisa,
Thank you for this wonderful script. Same as the previous commentor, I seem not able to copy the script, would it be possible for me to get a copy of the script as well? Many thanks Lisa
I’ve posted a text file of the script at https://www.rushworth.us/lisa/wp-content/uploads/2022/09/ExportingMSStreamTranscript.txt for anyone who might experience problems copy/pasting the content from my web site.
Hi Lisa, I am having troubles copying and pasting the code, do you thunk you can email me the code?
Certainly! I just sent you a message with the code from within this post.