Seeking script to embed my videos on others' tutorials
39 views
Skip to first unread message
Ellen Spertus
unread,
Dec 24, 2020, 4:34:39 PM12/24/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to greasemonkey-users
I am a CS professor and would like to embed my instructional videos on pages of the Kotlin Koans tutorial. Could you tell me if there is a script that would facilitate this or if it would be easy to create one?
All of my searches on embedding videos with GreaseMonkey have led to scripts for downloading videos, improving the YouTube experience, etc.
Thanks.
Ellen
Ellen Spertus
unread,
Dec 25, 2020, 6:21:09 PM12/25/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to greasemonkey-users
I installed TamperMonkey, and it turned out to be pretty trivial to add videos to the tutorial pages. I've appended my script. The video shown isn't mine (yet). I plan to add a dictionary to map from the level and task to the appropriate video.
(function() { 'use strict'; let re = new RegExp('https://play.kotlinlang.org/koans/([^/]+)/([^/]+)/Task.kt'); var url = window.location.href; var groups = re.exec(url); var level = groups[1]; var task = groups[2]; var d = $("div.editor-content"); var iframe = $('<iframe>', { width: 560, height: 315, src: "https://www.youtube.com/embed/NIVFgU5f2Rs", frameborder: 0 }); d.append(iframe); })();