Algorithm to calculate a page importance based on its views / comments
Posted
by stacker
on Stack Overflow
See other posts from Stack Overflow
or by stacker
Published on 2010-05-27T02:26:30Z
Indexed on
2010/06/01
23:13 UTC
Read the original article
Hit count: 480
I need an algorithm that allows me to determine an appropriate <priority>
field for my website's sitemap based on the page's views and comments count.
For those of you unfamiliar with sitemaps, the priority field is used to signal the importance of a page relative to the others on the same website. It must be a decimal number between 0 and 1.
The algorithm will accept two parameters, viewCount
and commentCount
, and will return the priority value. For example:
GetPriority(100000, 100000); // Damn, a lot of views/comments! The returned value will be very close to 1, for example 0.995
GetPriority(3, 2); // Ok not many users are interested in this page, so for example it will return 0.082
© Stack Overflow or respective owner