Wanted: Hot sorting criteria for front-page

AI-generated summary

commonpawn proposes a new “Hot” sorting criteria for the Discourse front-page, inspired by Hacker News, to ensure users always see the most popular content regardless of topic age. The current “Top” view is criticized for being limited to topics created within specific timeframes and having bizarre settings that require manual post-count adjustments. The proposed solution involves a custom algorithm where Score = L / (T + 2)^G (L=likes, T=hours since creation, G=gravity), allowing the gravity rate to be adjusted by admins. Key requirements include a new top-menu filter, the ability to set it as the default landing page, and infinite scrolling without fixed post limits. The thread seeks community developers for this potentially paid project. P16 suggests a simpler alternative: using the existing “Top” filter as a base, changing the default sort setting in Admin, and modifying the top_topic.rb file to adjust the sorting logic, noting that current filters already work well for their use case.

Following up on this thread from last year.

We would like to use a sorting criteria as Hacker News to make sure we’re always serving the most popular content to our users. We’re imagining using a similar algorithm to the one used on Hacker News.

Basically it should sort all topics on our forum on the front-page after this criteria - so you can keep scrolling forever. (Unlike top topics in Discourse today, which is limited to a pre-set number of topics within a time range)

We would like to use this simple algorithm:

Variables
L: Total number of likes on posts in topic
T: Hours since topic was created
G: Gravity (rate at which topics loose their position on the front-page)

G = 1.5

Score = L / (T + 2)^G

The gravity rate should be able to be changed from the settings page for admins of the forum.

Why not just use the default Top view
While we would like to use it, a number of things are different

  • The top view only shows popular topics created within the specific timeframe, e.g. a week. We want to show what was popular the last week - no matter the creation date of the topic.
  • The settings for the “Top view” is bizarre and requires the admin to specific a precise amount of posts to be shown for the desired timeframe, e.g. weekly. If there are not enough posts from this period, it switches the timeframe to monthly top posts.

More background here, here and here

Requirements

  • New filter in top menu on discourse installation
  • Has to be able to set as default filter of front-page, e.g. the landing page of a discourse installation
  • Has to filter based on above algorithm with the variable G - gravity - being able to be tweaked from the admin page
  • The filtering should filter all topics on the Discourse installation, e.g. so the user can continue to scroll forever and should not be limited to a fixed number of posts

We’re looking for developers from the community to help build this plugin, please get in touch if you’re interested.
Potentially a paid project.

Use the Top filter as the base for this, and change the setting for the sorting in Admin settings to make Top always load on dafault. Then tweak the following file and register it in your plugin:

I think that would be the way unless I am missing something. I personally use only Top and Latest, and for now they are working fine for my use case. Hope this helps.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.