# Wanted: Hot sorting criteria for front-page

**URL:** https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136
**Category:** Marketplace
**Created:** [7월 12, 2016, 1:31오전 UTC](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136 "2016-07-12T01:31:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![commonpawn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/commonpawn/32/50792_2.png) [@commonpawn](https://meta.discourse.org/u/commonpawn)
#### Post date: [7월 12, 2016, 1:31오전 UTC](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136/1 "2016-07-12T01:31:30Z")

</div>

_Following up on [this thread](https://meta.discourse.org/t/improving-the-top-criteria/26064/17) from last year._

[We would like](https://meta.discourse.org/t/dansk-dynamit-website-running-on-discourse/43430) to use a sorting criteria as [Hacker News](https://news.ycombinator.com/) 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.

 ![](https://global.discourse-cdn.com/meta/original/3X/2/1/21e172d3b80214dc4e660ef5d3f734bab6919024.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/e/2/e227604c17f09cd97122895d1cc79ccd108b2189.png)

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](https://meta.discourse.org/t/improved-top-page-settings/47173) 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](https://meta.discourse.org/t/hot-topics-this-quarter-month-week-today/42520), [here](https://meta.discourse.org/t/hot-topics-this-quarter-month-week-today/42520) and [here](https://meta.discourse.org/t/wanted-discourse-hacker-news-plugin/37620)_

**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.

---

<div class="post-metadata">

### Author: ![P16](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@P16](https://meta.discourse.org/u/P16)
#### Post date: [7월 12, 2016, 8:04오전 UTC](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136/4 "2016-07-12T08:04:10Z")

</div>

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:

> <https://github.com/discourse/discourse/blob/main/app/models/top_topic.rb#L143-L192>

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.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 11, 2016, 8:04오전 UTC](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136/7 "2016-08-11T08:04:34Z")

</div>

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