Home > Education, Useful Apps > UCLA Bruincast greasemonkey link ripper

UCLA Bruincast greasemonkey link ripper

Just a quick post on the simple greasemonkey script that rips UCLA Bruincast video links (obviously you need access). I made it for my brother, so he can download lectures for classes he would like to save. Here’s the short greasy script. (Remember, rename the urls from “http:” to “rtsp:”). To grab the DSL links simply replace ‘LAN’ with the text of the link. Enjoy!

// ==UserScript==
// @name           BruinCastPageLinks
// @namespace      hawflakes.unoc.net
// @description    Grabs Links on a page
// @include        http://www.oid.ucla.edu/webcasts/courses/*
// ==/UserScript==
 
// Greasemonkey Script written by Jonathan Wong, Copyright 2009
// Script is freeware (Use at your own risk!).
 
Links = findXPathNodes("//a[text()='LAN']/@href");
PrintString="";
 
for(i=0;i<links .snapshotLength;i++)
{
	PrintString=PrintString+Links.snapshotItem(i).value+"\n";
}
 
GM_openInTab("data:text;charset=UTF-8," + encodeURI(PrintString).replace(/&nbsp;/g,"&amp;nbsp;"));
 
function findXPathNode(xpath, start,doc)
{
	var result = (doc == null ? document : doc).evaluate(xpath,(start == null ? document : start), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE ,null);
	return (result.snapshotLength > 0 ? result.snapshotItem(0) : null);
}
 
function findXPathNodes(xpath, start,doc)
{
	return (doc == null ? document : doc).evaluate(xpath,(start == null ? document : start), null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE ,null);	
}
 
function elem(tagname,content)
{
	var ret = document.createElement(tagname);
	ret.innerHTML = content;
	return ret;
}
</links>
Categories: Education, Useful Apps Tags: ,
  • Dan

    Dude!!!! sick!! Ive been thinking how convenient it would be to be able to save those lectures. Now…to figure out how to use greasemonkey…

    thanks dude!

    -Dan

  • brandon

    sorry I’m pretty new to greasemonkey and installed the script but I don’t really understand what I’m supposed to do once it is installed. I did the rtsp thing but then it prompts me to open it with a program and I don’t know what program to use. I’ve tried vlc but it doesn’t work, and how do I save it to my computer?

    • http://jonblog.wong.lan Jon

      To be honest, i dont know if this script still works since i dont go to Ucla. I have no real way of verifying this myself.