Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Created December 20, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudiedirkx/88a954f63fda0312438f to your computer and use it in GitHub Desktop.
Save rudiedirkx/88a954f63fda0312438f to your computer and use it in GitHub Desktop.
javascript:
([].forEach.call(document.scripts, function(el, p) {
var code = el.innerHTML.trim();
if ( (p = code.indexOf('q("talkPage.init",')) > -1 ) {
var json = code.slice(p + 18, -1).trim();
var talk = JSON.parse(json).talks[0];
var url = talk.nativeDownloads.high || talk.nativeDownloads.medium;
var a = document.createElement('a');
a.href = url;
a.download = url.match(/([^\/\?]+)(\?.+?)?$/)[1];
a.style.display = 'none';
document.body.appendChild(a);
a.click();
a.remove();
}
}))();
void(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment