The second day thinking of how to work the algorithm of interesting news. It is clear that some kind of reversed selection all posts and then ranked. The problem occurs a little further.
For example, after the next ranking we have the following list:
1, 2, 3, 4, 5, 6, 7, 8, 9
To the user these records are given for 4 pieces per page.
A user opens the page and sees:
1, 2, 3, 4
Next, run kronotskoe task and redistributes stranic. That is, after the current ranking is the following list:
1, 5, 6, 4, 3, 2, 7, 8, 9
And when the user navigates to the second page, the server will give him the records he had already seen:
3, 2, 7, 8
Link to the second page, something like '?list=ID&page=2'
Where ID is the id of the last list.
For example, on habré score on it...
UPD: so as not to score the address bar and the search engines, it is possible to store this ID in a cookie
antoinette18 answered on August 19th 19 at 23:48
You can do to remove the pagination control and do just that first displays 5 pieces, then when I scrolled the wheel up to the bottom of the page displays the following (without reloading the page), the image as made news in the VC.
zakary.Lockman47 answered on August 19th 19 at 23:50
Right these ribbons are constructed depending on the approach.
1. When the ranking is global. In this case, each record has some grade - a calculated field that is recalculated at the event. For example, when someone makes a comment or on every seventh viewing. The logic of the calculation of the grade depends on the resource and content. Well, after rudimentary sorting. If you want, you can exclude viewed articles.
2. When the ranking depends on user preferences. In this case, the user in a background process is the calculation of the rank or tape is constructed on the fly. To create a ribbon on the fly applies a combination of graph and regular bases. Graph can quickly calculate the degree of effects of the preferences and relationships between users.