Last active
August 29, 2015 14:04
-
-
Save carymrobbins/3eb57a3f43cf11cfd858 to your computer and use it in GitHub Desktop.
Copy Limechat discussion to HTML file, open it in the browser, then run this in the console to print the discussion in a simple text format.
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
| var rows = []; | |
| var xs = $('body').children; | |
| for (var i = 0; i < xs.length; ++i) { | |
| var ys = xs[i].children; | |
| if (ys.length >= 3) { | |
| rows.push([ys[1].textContent, ys[0].textContent, ys[2].textContent]) | |
| } | |
| } | |
| var maxNickLen = Math.max.apply(null, rows.map(function(r) { return r[0].length })); | |
| console.log(rows.map(function(r) { | |
| return r[0] + new Array(maxNickLen - r[0].length + 2).join(' ') + r[1].trim() + ' '+ r[2]; | |
| }).join('\n')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment