Skip to content

Instantly share code, notes, and snippets.

@evadne
Last active April 18, 2023 18:01
Show Gist options
  • Save evadne/5794585 to your computer and use it in GitHub Desktop.
Save evadne/5794585 to your computer and use it in GitHub Desktop.
WWDC 2013 Videos / Slides (PDF) Downloader — run in a JavaScript console / interpreter hooked to the videos page
// Download all assets from https://developer.apple.com/wwdc/videos
// Warning: might take up a lot of disk space
NodeList.prototype.toArray = function () {
return Array.prototype.slice.call(this);
};
[].concat.apply([], document.querySelectorAll("li.session").toArray().map(function(session){
var sessionID = session.id.match(/^\d+/)[0];
var title = session.querySelector(".title").innerText;
var track = session.querySelector(".track").innerText;
var date = session.querySelector(".date").innerText;
var allLinks = session.querySelectorAll("a[href^='http://devstreaming']").toArray();
var titleText = "Session " + sessionID + " - " + title;
return allLinks.map(function(link){
var filename = link.pathname.match(/([^/]+)\.[^\.]+/)[0];
return "curl \"" + link.href + "\" -o \"" + titleText + " - " + filename + "\"";
});
})).map(function(x){
console.log(x);
return x;
}).join("\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment