# Discourse 热门话题

**URL:** https://meta.discourse.org/t/discourse-hot-topics/48215
**Category:** Plugin
**Tags:** deprecated
**Created:** [2016年八月4日 14:02 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215 "2016-08-04T14:02:53Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2016年八月4日 14:02 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/1 "2016-08-04T14:02:53Z")

</div>

> ℹ Discourse now features a `/hot` topic list in core that can be added to your `top menu`

Repository: [GitHub - danskdynamit/discourse-hot-topics · GitHub](https://github.com/danskdynamit/discourse-hot-topics)

This plugin creates a “Hot” sorting criteria and builds a custom topic list based on the result of the following formula:

`likes / ((hours since creation + 2) ^ gravity)`

Things to note:

- The default gravity multiplier is 1.5 but you can adjust this in the settings for the plugin.
- You can add “hot” to the list of menu items to make it easier to access.
- There is also the option to add `?order=hot` to a URL to create your own links.
- Once enabled, the hot rating is recalculated every 30 minutes so it will take a bit of time to take effect at first. If you want to accelerate this, you can log in to Sidekiq and manually trigger the `HotRating` job.

This work was graciously sponsored by @commonpawn and @Oskar. Kudos to them for making this happen.

The following topics lend more background to why this exists:

> [@Wanted: Hot sorting criteria for front-page](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136):
>
> 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. 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) W…

> [@Wanted: Discourse Hacker News Plugin](https://meta.discourse.org/t/wanted-discourse-hacker-news-plugin/37620/19):
>
> We worked with @joebuhlig to [try implement](https://meta.discourse.org/t/mounting-widget-in-raw-template/44400) the voting buttons on the front page - but it turned out it was not as easy as we thought. So we’ve put that on ice for now. So the plan for our site is to use plugin, [Topic Previews](https://meta.discourse.org/t/topic-list-previews/41630), to display a like button on the front-page and we’re currently working with @joebuhlig on building a ‘[hot topics page](https://meta.discourse.org/t/wanted-hot-sorting-criteria-for-front-page/47136)’ which is using a similar algorithm as Hackernews to sort topics. It should be done very soon and released on Github when ready. Below how we plan to imp…

[https://meta.discourse.org/t/topic-list-previews/41630/299](https://meta.discourse.org/t/topic-list-previews/41630/299)

---

<div class="post-metadata">

### Author: ![Mans](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Mans](https://meta.discourse.org/u/Mans)
#### Post date: [2016年十月5日 06:13 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/2 "2016-10-05T06:13:54Z")

</div>

In our community, we need hottest topic for a specific category. can this plugin do that?

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2016年十月5日 11:31 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/3 "2016-10-05T11:31:43Z")

</div>

Yes.

Go to the category page you want and then select Hot from the menu. The URL will look similar to this: `yourdomain.com/c/CATEGORY/l/hot`.

---

<div class="post-metadata">

### Author: ![kam44](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kam44](https://meta.discourse.org/u/kam44)
#### Post date: [2016年十二月9日 18:29 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/4 "2016-12-09T18:29:25Z")

</div>

Hello @joebuhlig,

Is it possible to change the frequence of the HotRating job in sidekiq ?

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2016年十二月9日 21:18 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/5 "2016-12-09T21:18:09Z")

</div>

Give this a try:

[https://github.com/danskdynamit/discourse-hot-topics/commit/c13c1a6857146d532be4c124c0841791243b424c](https://github.com/danskdynamit/discourse-hot-topics/commit/c13c1a6857146d532be4c124c0841791243b424c)

It adds a setting `hot_topics_calc_period` that lets you set the period (in minutes). Note that you’ll need to do a rebuild every time this setting is changed before it will take effect.

---

<div class="post-metadata">

### Author: ![kam44](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kam44](https://meta.discourse.org/u/kam44)
#### Post date: [2016年十二月9日 22:55 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/6 "2016-12-09T22:55:53Z")

</div>

Thank you @joebuhlig !

---

<div class="post-metadata">

### Author: ![kam44](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kam44](https://meta.discourse.org/u/kam44)
#### Post date: [2016年十二月22日 15:28 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/8 "2016-12-22T15:28:19Z")

</div>

Hello Joe,

Is the “staff like weight” parameter is taken into account in the hot topic plugin ?

 ![](https://global.discourse-cdn.com/meta/original/3X/4/0/408d3b7323139b6a3f8310406aee978247aaf8c9.png)

This option is in the parameters “other” tab.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2016年十二月23日 13:00 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/9 "2016-12-23T13:00:44Z")

</div>

Currently, it is not.

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2017年一月5日 12:28 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/10 "2017-01-05T12:28:14Z")

</div>

6 posts were split to a new topic: [Prevent fast and short replies when a flame war is ongoing](https://meta.discourse.org/t/prevent-fast-and-short-replies-when-a-flame-war-is-ongoing/55209)

---

<div class="post-metadata">

### Author: ![kam44](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kam44](https://meta.discourse.org/u/kam44)
#### Post date: [2017年一月8日 12:12 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/11 "2017-01-08T12:12:34Z")

</div>

Hello @joebuhlig,

After some tests, i’m pretty sure that replies likes, are taken into account in the formula. I think it’ll be better and more logical, to only takes likes of the first post.

Don’t you think ?

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2017年一月8日 13:49 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/12 "2017-01-08T13:49:17Z")

</div>

> [@kam44](#):
>
> i’m pretty sure that replies likes, are taken into account in the formula.

Yes. It does count likes on all posts. It’s beyond me on whether or not that’s a good way to do it. The formula is a copy from other models. @commonpawn and @Oskar, do either of you have a strong leaning here?

---

<div class="post-metadata">

### Author: ![kam44](https://avatars.discourse-cdn.com/v4/letter/k/e47c2d/32.png) [@kam44](https://meta.discourse.org/u/kam44)
#### Post date: [2017年一月8日 19:50 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/13 "2017-01-08T19:50:30Z")

</div>

@joebuhlig if you have a bit time and if @commonpawn and @Oskar are ok, i can sponsorize this job, to add an option to take or not in account replies likes.

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2017年一月9日 18:17 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/14 "2017-01-09T18:17:15Z")

</div>

> [@kam44](#):
>
> i can sponsorize this job, to add an option to take or not in account replies likes

Just sent you a PM. 😉

---

<div class="post-metadata">

### Author: ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)
#### Post date: [2017年一月9日 19:12 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/15 "2017-01-09T19:12:55Z")

</div>

Sometimes things work out really quick. Thanks to @kam44 for making this happen.

You can now choose to use only the likes on the original post in the calculation as opposed to likes across all replies.

[https://github.com/danskdynamit/discourse-hot-topics/commit/fcb645064cbea9ff2bc06099f730541c01259773](https://github.com/danskdynamit/discourse-hot-topics/commit/fcb645064cbea9ff2bc06099f730541c01259773)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [2017年二月6日 14:48 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/16 "2017-02-06T14:48:00Z")

</div>

The plugin works well, but does it do the “x new posts. Click to refresh” live updating that is done on the core lists? It would be nice if it could (not so much to change the order of the posts, but to notify the users as to which posts have replies…)

---

<div class="post-metadata">

### Author: ![skozz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skozz/32/119704_2.png) [@skozz](https://meta.discourse.org/u/skozz)
#### Post date: [2017年二月6日 21:43 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/17 "2017-02-06T21:43:36Z")

</div>

I’m getting a 500 (`/hot` route) error after installing it and I’ve run the HotRating job, I’m missing something?

---

<div class="post-metadata">

### Author: ![erlend\_sh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/erlend_sh/32/119475_2.png) [@erlend\_sh](https://meta.discourse.org/u/erlend_sh)
#### Post date: [2017年三月3日 14:47 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/18 "2017-03-03T14:47:13Z")

</div>

Regarding this:

> [@Discourse Topic Voting](https://meta.discourse.org/t/discourse-topic-voting/40121/183):
>
> As it stands, the Top view doesn’t actually work, since it’s still based on Likes and other metrics. To avoid confusion, it’d probably be best if a voting-category excluded Top entirely, and instead showed “Most voted”, simply showing the most voted ideas in descending order, like on UserVoice.

Do you think Hot Topics could be made to support Feature Voting as well? Or would it be easier if Feature Voting just comes with its own concept of “Hot” sorting?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2017年三月3日 18:32 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/19 "2017-03-03T18:32:47Z")

</div>

I see no reason for a cascade of dependency, feature voting can take care of itself

---

<div class="post-metadata">

### Author: ![randallcoding](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@randallcoding](https://meta.discourse.org/u/randallcoding)
#### Post date: [2019年十一月1日 02:10 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/20 "2019-11-01T02:10:51Z")

</div>

使用此插件时遇到了错误。

我将插件添加到 Discourse 的 plugins 文件夹，然后使用 `bundle exec rails server` 启动 Rails 服务器，结果遇到了这个错误。只有这个插件出现了此类错误。

> 1: from …/plugins/discourse-hot-topics/plugin.rb:98:in `block in activate!' .../plugins/discourse-hot-topics/plugin.rb:100:in `module:Jobs’: uninitialized constant Jobs::jobs::Scheduled  
> Did you mean? Scheduler (NameError)
> 
> \*\* 不兼容的插件 \*\*

我是 Discourse 的新手，也许我犯了一些致命错误？还是其他人也遇到了同样的问题？

我使用的是 Ruby 2.6.1 和 Rails 6.0.0，以及来自 GitHub 的最新版本的 Discourse。

---

<div class="post-metadata">

### Author: ![hyd504](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hyd504/32/177122_2.png) [@hyd504](https://meta.discourse.org/u/hyd504)
#### Post date: [2021年一月30日 19:02 UTC](https://meta.discourse.org/t/discourse-hot-topics/48215/21 "2021-01-30T19:02:31Z")

</div>

更改

> class HotRating \< Jobs::Scheduled

为

> class HotRating \< Scheduled

这对我有效。我认为问题出现的原因是该类已经封装在模块 `::Jobs` 中，因此我们无需再次指定该模块。

[下一頁](https://meta.discourse.org/t/discourse-hot-topics/48215.md?page=2)
