Skip to content

Instantly share code, notes, and snippets.

@polentino
Created October 30, 2017 16:18
Show Gist options
  • Save polentino/0ecadd6cfebb7fd852db3aa2d0e4bd27 to your computer and use it in GitHub Desktop.
Save polentino/0ecadd6cfebb7fd852db3aa2d0e4bd27 to your computer and use it in GitHub Desktop.
A quick and dirty javascript code to extract English talks from Scala.io website, and save it into a file 'talk-list.txt' to share to your colleagues/friends.
var talks = $("li.talk").filter(function() {
return $(this).css('background-image').indexOf('en.svg') != -1;
});
var summary = "";
$.each(talks, function(idx, talk) {
summary += '[' + idx + '] ' + $(talk).find('a.talk-title').text();
summary += '\n\tDescription: ' + $(talk).find('> div').text();
summary += '\n\n';
});
var fakeLink = document.createElement('a');
fakeLink.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(summary));
fakeLink.setAttribute('download', 'talk-list.txt');
fakeLink.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment