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(/ /g,"&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> |