Post Reply 
Ever wish you could sort all posts in a thread by the number of likes?
Author Message
one-two Offline
Chubby Chaser
**

Posts: 348
Joined: Nov 2011
Reputation: 3
Post: #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:
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.
11-05-2015 03:32 AM
Find all posts by this user Like Post Quote this message in a reply
The Beast1 Offline
Innovative Casanova
*******
Gold Member

Posts: 7,540
Joined: May 2013
Reputation: 81
Post: #2
RE: 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.
11-05-2015 03:34 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 6 users Like The Beast1's post:
Matrixdude, 262, J. Spice, Enigma, Travesty, Prince Machiavelli
Sooth Offline
Alpha Male
****
Gold Member

Posts: 1,112
Joined: Feb 2015
Reputation: 14
Post: #3
RE: 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.

(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.
11-05-2015 03:43 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 2 users Like Sooth's post:
one-two, Barron
cascadecombo Offline
True Player
*****

Posts: 1,832
Joined: May 2014
Reputation: 22
Post: #4
RE: 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?
11-05-2015 03:52 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 5 users Like cascadecombo's post:
Suits, Paracelsus, tynamite, MMX2010, kmhour
Thoroughbred Offline
Chubby Chaser
**
Gold Member

Posts: 291
Joined: May 2013
Reputation: 3
Post: #5
RE: Ever wish you could sort all posts in a thread by the number of likes?
No.

"Pain is certain, suffering is optional" - Buddah
11-05-2015 04:24 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes Thoroughbred's post:
Rutting Elephant
Matrixdude Offline
Recovering Beta
*

Posts: 198
Joined: Jul 2015
Reputation: 4
Post: #6
RE: Ever wish you could sort all posts in a thread by the number of likes?
(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.
11-05-2015 05:24 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes Matrixdude's post:
Enigma
Paracelsus Offline
Innovative Casanova
*******
Gold Member

Posts: 6,125
Joined: Sep 2014
Reputation: 147
Post: #7
RE: Ever wish you could sort all posts in a thread by the number of likes?
No. Any other questions?
11-05-2015 05:38 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes Paracelsus's post:
Rutting Elephant
Vice Offline
Recovering Beta
*
Gold Member

Posts: 232
Joined: Mar 2012
Reputation: 1
Post: #8
RE: 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).
11-05-2015 08:48 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 2 users Like Vice's post:
one-two, MMX2010
heavy Offline
True Player
*****
Gold Member

Posts: 2,786
Joined: Sep 2013
Reputation: 36
Post: #9
RE: 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.”
(This post was last modified: 11-05-2015 08:53 AM by heavy.)
11-05-2015 08:52 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes heavy's post:
tynamite
wi30 Offline
True Player
*****
Gold Member

Posts: 1,906
Joined: Jul 2010
Reputation: 59
Post: #10
RE: 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
11-05-2015 08:52 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes wi30's post:
RoastBeefCurtains4Me
Thomas the Rhymer Offline
True Player
*****
Gold Member

Posts: 2,056
Joined: Feb 2012
Reputation: 114
Post: #11
RE: 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.

A beginner's guide to jobhunting and networking
11-05-2015 10:20 AM
Find all posts by this user Like Post Quote this message in a reply
one-two Offline
Chubby Chaser
**

Posts: 348
Joined: Nov 2011
Reputation: 3
Post: #12
RE: Ever wish you could sort all posts in a thread by the number of likes?
(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
11-05-2015 03:49 PM
Find all posts by this user Like Post Quote this message in a reply
Tigre Offline
Wingman
***
Gold Member

Posts: 927
Joined: Feb 2012
Reputation: 51
Post: #13
RE: Ever wish you could sort all posts in a thread by the number of likes?
+ 3+-
11-05-2015 04:12 PM
Find all posts by this user Like Post Quote this message in a reply
Foolsgo1d Offline
Innovative Casanova
*******

Posts: 6,641
Joined: Apr 2014
Reputation: 27
Post: #14
RE: 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.
(This post was last modified: 11-05-2015 04:25 PM by Foolsgo1d.)
11-05-2015 04:25 PM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 2 users Like Foolsgo1d's post:
RIslander, Tigre
eljeffster Offline
Wingman
***

Posts: 862
Joined: Jul 2014
Reputation: 9
Post: #15
RE: 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!
11-06-2015 10:44 AM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes eljeffster's post:
Rutting Elephant
roberto Offline
Alpha Male
****
Gold Member

Posts: 1,338
Joined: Jun 2013
Reputation: 18
Post: #16
RE: 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...
11-06-2015 11:27 AM
Find all posts by this user Like Post Quote this message in a reply
The Beast1 Offline
Innovative Casanova
*******
Gold Member

Posts: 7,540
Joined: May 2013
Reputation: 81
Post: #17
RE: 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....
11-06-2015 11:29 AM
Find all posts by this user Like Post Quote this message in a reply
kmhour Offline
Chubby Chaser
**

Posts: 357
Joined: Apr 2014
Reputation: 2
Post: #18
RE: 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.
11-06-2015 01:13 PM
Find all posts by this user Like Post Quote this message in a reply
[-] The following 1 user Likes kmhour's post:
Rutting Elephant
SirTimothy Offline
Chubby Chaser
**

Posts: 590
Joined: Jan 2015
Reputation: 7
Post: #19
RE: Ever wish you could sort all posts in a thread by the number of likes?
(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.
(This post was last modified: 11-06-2015 01:41 PM by SirTimothy.)
11-06-2015 01:30 PM
Find all posts by this user Like Post Quote this message in a reply
eljeffster Offline
Wingman
***

Posts: 862
Joined: Jul 2014
Reputation: 9
Post: #20
RE: Ever wish you could sort all posts in a thread by the number of likes?
(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. . .
11-06-2015 09:30 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Posts that deserved recognition / praise Vladimir Poontang 6 1,335 05-14-2019 08:44 PM
Last Post: Tex Cruise
  Assanova Is Back, Sort Of... jariel 43 27,815 05-10-2019 10:45 PM
Last Post: busterrhymes
  What do you think members' posts look like? polar 35 4,475 03-26-2019 08:32 PM
Last Post: TigerMandingo

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | RooshV.com | Return to Top | Return to Content | Mobile Version | RSS Syndication