When I come across an interesting thread, I scan for the most liked posts first. On reddit, most popular posts float to the top. But on a forum like this it is all chronological. So I figured I'd write some code for fun after a long day of writing code for money.
Here is the source code in a readable format
https://github.com/serg-mo/forum_bookmarklet
Here is the same source code inline. Make a bookmark. Name it what you want. Paste this as the url.
Code:
Note: this will probably not work on any other forum and it gets super slow on long threads, especially if they have lots of images embedded in them.
Here is the source code in a readable format
https://github.com/serg-mo/forum_bookmarklet
Here is the same source code inline. Make a bookmark. Name it what you want. Paste this as the url.
Code:
Code:
javascript:%20var%20posts%20=%20[];%20get_page(1);%20function%20get_page(page)%20{%20var%20url%20=%20window.location.href%20+%20"?page="%20+%20page;%20var%20meta%20=%20{%20method:%20'get'%20};%20meta.onSuccess%20=%20function%20(xhr)%20{%20get_content(page,%20xhr.responseText);%20};%20new%20Ajax.Request(url,%20meta);%20}%20function%20get_content(page,%20content)%20{%20var%20total%20=%20content.match(/Pages%20((d+))/i)[1];%20if(page%20<%20total)%20{%20var%20matches%20=%20content.split(/<!--%20(start|end):%20postbit%20-->/i);%20matches%20=%20matches.filter(function(v){%20return%20v.length%20>%205;%20});%20Array.prototype.push.apply(posts,%20matches);%20get_page(page%20+%201);%20}%20else%20process_content();%20}%20function%20process_content()%20{%20var%20head%20=%20posts.shift();%20var%20tail%20=%20posts.pop();%20posts.sort(function(a,%20b){%20return%20get_likes(b)%20-%20get_likes(a);%20});%20document.write("ALL%20POSTS%20SORTED%20BY%20DESCENDING%20LIKES");%20document.write(head);%20for(var%20i%20=%200;%20i%20<%20posts.length;%20i++)%20document.write(posts[i]);%20document.write(tail);%20}%20function%20get_likes(content)%20{%20var%20matches%20=%20content.match(/The%20following%20(d+)%20users%20Like/i);%20return%20(matches%20!=%20null)?matches[1]:0;%20}