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:
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.
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.
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?
@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.
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âŠ)
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?
I added the plugin to the plugins folder in discourse then started up my rails server with bundle exec rails server and ran into this error. Only this plugin has yielded any errors like this.
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)
** INCOMPATIBLE PLUGIN **
Iâm new to discourse so perhaps Iâm making some fatal mistake? or is anyone else having this same issue.
Iâm using Ruby 2.6.1 and Rails 6.0.0, latest version of discourse from Github.
This worked for me. I believe the issue happens because this class is already wrapped inside module ::Jobs so we donât have to specify the module again.