Seeking script to embed my videos on others' tutorials

Skip to first unread message

Ellen Spertus

Dec 24, 2020, 4:34:39 PM12/24/20
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.



Ellen Spertus

Dec 25, 2020, 6:21:09 PM12/25/20
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.

// ==UserScript==
// @name         Ellen's experiment
// @namespace
// @version      0.1
// @description  show my videos
// @author       Ellen
// @match*
// @grant        none
// @require
// ==/UserScript==

(function() {
    'use strict';
    let re = new RegExp('[^/]+)/([^/]+)/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: "",
        frameborder: 0

Reply all
Reply to author
0 new messages