rooshvforum.network is a fully functional forum: you can search, register, post new threads etc...
Old accounts are inaccessible: register a new one, or recover it when possible. x


Ever wish you could sort all posts in a thread by the number of likes?
#1

Ever wish you could sort all posts in a thread by the number of likes?

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:
Code:
javascript:%20var%20posts%20=%20[];%20get_page(1);%20function%20get_page(page)%20{%20var%20url%20=%20window.locati​on.href%20+%20"?page="%20+%20page;%20var%20meta%20=%20{%20method:%20'get'%20};%20meta.onSuccess%20=%20​function%20(xhr)%20{%20get_content(page,%20xhr.responseText);%20};%20new%20Ajax.​Request(url,%20meta);%20}%20function%20get_content(page,%20content)%20{%20var%20​total%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%2​0+%201);%20}%20else%20process_content();%20}%20function%20process_content()%20{%​20var%20head%20=%20posts.shift();%20var%20tail%20=%20posts.pop();%20posts.sort(f​unction(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%20match​es%20=%20content.match(/The%20following%20(d+)%20users%20Like/i);%20return%20(matches%20!=%20null)?matches[1]:0;%20}
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.
Reply
#2

Ever wish you could sort all posts in a thread by the number of likes?

Honestly if I wanted Digg or Reddit i'd go to those sites. The "most liked" post phenomena ruins intellectual discourse for pandering to majority group thing.
Reply
#3

Ever wish you could sort all posts in a thread by the number of likes?

When I was studying I had time to basically read the whole forum but now working 10-11 hour days I can only skip through for 15 mins and usually pay more attention to the most liked posts.

Quote: (11-05-2015 03:34 AM)The Beast1 Wrote:  

Honestly if I wanted Digg or Reddit i'd go to those sites. The "most liked" post phenomena ruins intellectual discourse for pandering to majority group thing.

Reading the "majority group think" of the best forum on the internet is a very good way to spend my limited time.
Reply
#4

Ever wish you could sort all posts in a thread by the number of likes?

I predict that after using ops code, any new person to this forum will only want to know one thing.

That one thing being.

Who the fuck is little dark?
Reply
#5

Ever wish you could sort all posts in a thread by the number of likes?

No.

"Pain is certain, suffering is optional" - Buddah
Reply
#6

Ever wish you could sort all posts in a thread by the number of likes?

Quote: (11-05-2015 03:34 AM)The Beast1 Wrote:  

Honestly if I wanted Digg or Reddit i'd go to those sites. The "most liked" post phenomena ruins intellectual discourse for pandering to majority group thing.

This is exactly why I stay away from those places.

The hive mind censors contrarian viewpoints by hiding them at the bottom.

I think it would be best if there was an archive of the most liked "content with some context" type of thing, pinned in a new subforum.
Reply
#7

Ever wish you could sort all posts in a thread by the number of likes?

No. Any other questions?

Remissas, discite, vivet.
God save us from people who mean well. -storm
Reply
#8

Ever wish you could sort all posts in a thread by the number of likes?

Not sure why everyone is against this. Sorting by likes would actually be pretty good for the Travel Forum, especially in those megathreads which stretch 50+ pages (like the ones on Poland, Ukraine, and the Philippines).
Reply
#9

Ever wish you could sort all posts in a thread by the number of likes?

I'm not a computer guy but...

Pasting that code into the url bar didn't work

“Until you make the unconscious conscious, it will direct your life and you will call it fate.”
Reply
#10

Ever wish you could sort all posts in a thread by the number of likes?

LouieG made a thread containing posts with 50+ likes.
thread-33837...most+likes

Samsamsam also has a thread on best posts.
thread-51109.html
Reply
#11

Ever wish you could sort all posts in a thread by the number of likes?

I thought it would be fun to try out but I can't get it to work.

One-two, your bookmark instructions make no sense. Copy and pasting the url doesn't work. I tried to run the code in Firefox Web Console and I got a syntax error.
Reply
#12

Ever wish you could sort all posts in a thread by the number of likes?

Quote: (11-05-2015 10:20 AM)Thomas the Rhymer Wrote:  

I thought it would be fun to try out but I can't get it to work.

One-two, your bookmark instructions make no sense. Copy and pasting the url doesn't work. I tried to run the code in Firefox Web Console and I got a syntax error.

I'll check it out later today
Reply
#13

Ever wish you could sort all posts in a thread by the number of likes?

+ 3+-
Reply
#14

Ever wish you could sort all posts in a thread by the number of likes?

If you think the like system would benefit your own browsing then I would suggest heading into some threads such as the ass licking thread located in Game.

A lot of liked posts in there but the #1 liked post is a Homer .gif disappearing into a bush.
Reply
#15

Ever wish you could sort all posts in a thread by the number of likes?

Like everyone is saying it will only encourage posters to cater their posts to gain maximum likes, and less about speaking their mind. That is the realm of facebook et. al. which we castigate chicks for.

[Internal voice] God I hope I get, like, thousands of, like, likes for this post. I like, need the validation so much!
Reply
#16

Ever wish you could sort all posts in a thread by the number of likes?

^ I can't help it, I went to click 'Like'. Oh, the irony!

They who would give up essential Liberty, to purchase a little temporary Safety, deserve neither Liberty nor Safety- Benjamin Franklin, as if you didn't know...
Reply
#17

Ever wish you could sort all posts in a thread by the number of likes?

I was hoping for more likes so I would appear at the top of the search....
Reply
#18

Ever wish you could sort all posts in a thread by the number of likes?

I don't think that would add positively to the intended dialog. Like it or not, the "Like" system already leads to people pandering for 'upvotes'. I know I've been guilty of it myself. I think some of my most "Liked" posts are more meme-oriented and some posts I put actual time and thought into trying to articulate a point barely seemed noticed. Filtering/ordering on the number of likes would turn a discussion forum into a popularity contest. It's fine the way it is, in my opinion.
Reply
#19

Ever wish you could sort all posts in a thread by the number of likes?

Quote: (11-06-2015 01:13 PM)kmhour Wrote:  

I don't think that would add positively to the intended dialog. Like it or not, the "Like" system already leads to people pandering for 'upvotes'. I know I've been guilty of it myself. I think some of my most "Liked" posts are more meme-oriented and some posts I put actual time and thought into trying to articulate a point barely seemed noticed. Filtering/ordering on the number of likes would turn a discussion forum into a popularity contest. It's fine the way it is, in my opinion.

Ditto. It also just seems kind of unnecessary. If I want to see the most liked posts in a thread, I can always just zip through a page and stop when I see a bunch of likes.
Reply
#20

Ever wish you could sort all posts in a thread by the number of likes?

Quote: (11-06-2015 11:27 AM)roberto Wrote:  

^ I can't help it, I went to click 'Like'. Oh, the irony!

I know, and look how many "likes" this thread is racking up already. . .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)