Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#REF:https://www.reddit.com/r/ProgrammerHumor/comments/ax6dcu/computing_in_the_90s_vs_computing_in_2018/ehrwej6/
- //keygenmusic.net file list.
- //Go to http://keygenmusic.net/?page=allteams and run the script below for latest list
- //CSV Result will be placed in your clipboard and JSON result displayed in the console
- //script
- (function () {
- var getTeam = function (container) {
- var team = container.querySelector(".menutitle").textContent.trim();
- var ret = {
- name: team,
- files: []
- };
- var list = container.querySelectorAll(".teamtable td > a");
- for (var i = 0; i < list.length; i += 2) {
- var url = list[i].href.match(/([^/]+)\.[^.]+$/)[1];
- try {
- url = decodeURIComponent(url);
- } catch {
- console.warn("Will take Invalid URL as-is:", url);
- }
- var obj = {
- title: list[i].textContent.trim(),
- file: url,
- id: +list[i + 1].href.match(/fileid=(\d+)/)[1]
- };
- ret.files.push(obj);
- }
- return ret;
- };
- var ret = [];
- document.querySelectorAll(".teamcontainer").forEach(function (v) {
- ret.push(getTeam(v));
- });
- console.log(ret);
- //make CSV output too to copy into spreadsheet application
- var csv = ["id\tTeam\tName\tFile"];
- Object.keys(ret).forEach(function (v) {
- var files = ret[v].files;
- files.forEach(function (f) {
- csv.push([f.id, ret[v].name, f.title, f.file].join('\t'));
- });
- });
- copy(csv.join('\r\n'));
- })();
Add Comment
Please, Sign In to add comment