Created
October 30, 2017 10:48
-
-
Save ianchen06/c63bf29d132223ba06d49d7fa7ef75cf to your computer and use it in GitHub Desktop.
sort the archive.org list of UC Berkeley video links by course date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This code is to be executed inside the browser on archive.org page for the UC Berkeley webcast dump | |
https://archive.org/details/ucberkeley-webcast-PL-XXv-cvA_iCfQHHS7rxlfHFsU4aQW1IF | |
--- | |
author: Ian Chen | |
MIT | |
*/ | |
// Get a tags | |
var aa=[];for (x of window.document.querySelectorAll('.item-ttl > a')){a.push(x)}; | |
// Inject lodash for sortBy | |
var el = document.createElement('script'); | |
el.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.js"; | |
el.type = "text/javascript"; | |
document.head.appendChild(el) | |
for(x of _.sortBy(aa, (x)=>x.textContent)){console.log(x.href)} | |
// Open new tab and write the result | |
f = window.open('', '_blank', 'toolbar=yes, location=yes, status=yes, menubar=yes, scrollbars=yes'); | |
for(x of _.sortBy(aa, (x)=>x.textContent)){f.document.write(`<p><a href="${x}">${x.textContent}</a></p>`)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment