I would like to create some kind of an algorithm to my website like Reddit might have or even other websites. The algorithm, probably powered by the Rules module, should be able to promote content to the front page by number of hits (reads or visits), or comments a node receives. I can't seem to find any solution with the Rules module. Any help?!
2 Answers
The near defacto solution for this is the Radioactivity module:
This module provides a field type which can be used as a hotness metric or a regular view counter for entities and for much much more. In essense, entities receiving attention (views or actions defined by Rules) are heated while inactive ones slowly cool down.
As opposed to straight pageviews, this uses an algorithm to take activity-over-time into account. With straight statistics / counts, an old page with low activity per day can perpetually stay at the top of lists because it slowly accumulates statistics.
Radioactivity takes time into account, so that your newer pages can appear at the top when appropriate, and then roll off at the appropriate time. It relies on Rules, but integrates nicely with Views, for building the lists of things (either pages or blocks).
-
I can't seem to find a way to make it work with rules and I've tried to work with Radioactivity in the past but still don't understand how it works. Thank you for your help!– staion16Commented May 23, 2017 at 15:42
The Weight module might help you for this. Some details about it (from its community documentation):
The Weight module adds a weight option to enabled node types. Nodes with lower weight will float to the top of lists, while heavier items will sink to the bottom of lists. This is useful for sorting non-chronological nodes like bios, e-commerce products, or whatever you would like and for ordering nodes on the front page.
The "standard" Drupal sort order for nodes is by sticky, then by created date. Weight uses the node table's 'sticky' column to store weights as well as sticky information (so that feature is not lost). So then nodes will be sorted first by stickiness, then by weight, then by creation date.
This is a simple module with a simple purpose that can add a lot of value to your site with very little overhead.
It has over 48K of reported installs, and an official release for anything between D5 and D8.
To actually use it in combination with the Rules module, you may have to create your own custom Rules Action(s). For that you can start from the patch attached to this issue.
If you're in for even more Node ordering modules, then checkout Comparison of Node/Entity Ordering Modules.
-
The weight module is even harder to understand and work with, thanks anyway!– staion16Commented May 23, 2017 at 15:43