Sorting by Popularity?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This is... I guess more of a programming structure question than
How does one index the popularity of something?  Overall usage?  How
does recent-term popularity come in?  Is there an algorithm for
weighting the popularity, or does one just index a popularity value for
forever, 1 week, 1 day, etc?  And in that case, how does one know when
oldd 'hits' pass out of current consideration?

I mean- this sort of problem has existed for twenty years.  I'm
TRUSTING (hoping) there is some sort of disgustingly elegant but
anti-intuitive solution for this sort of thing I'm just not seeing.


Re: Sorting by Popularity?

Filling out an application for Google, eh? ;)

My 0.02 ( in the scope of ranking web pages ):

I did an AI project where pages were dynamically ranked. I factored in
a few things:

1. direct clicks to a page
2. keywords within the page that match what I was searching for.
3. Relative position of keywords to other keywords on the page
4. Number of links from the page
5. Pages that linked to a clicked page

For your algorithm, I think it depends on exactly what you are ranking.
For instance, I will likely rank medical information differently than
tech information. It depends on what your customers are looking for.

Never the less, it's a fun topic to discuss.

Re: Sorting by Popularity?

Quoted text here. Click to load it

No, sub-genere web-directory.  The idea is to let the members of a
fandom index the several thousand pages online by category (multiple
possible categories allowed per page) and have it auto-ranking.
(in-category rank seperate from overall popularity, to prevent
selection depth wash-out on the top 10's.)

I take it your answer is- 'track several indices, and use an algorithm
to average them out in some sane way.'

Thus, I guess, I must ask again- is there an elegant way to teack 'just
the hits in the last week,' essentiallg dropping the 'back-end' hits as
they elapse past the hit-time, WITHOUT keeping an individual record of
all hits over the course of the week?


Re: Sorting by Popularity? wrote:
Quoted text here. Click to load it

You could try daily totals...  Say, you have a MySQL table called hits:

  id (INT): Page ID
  date (DATE): Day for which you need to know the number of hits
  hits (INT): Hit count

The table's primary key is a two-column index based on `id` and `date`.

Every time a page is accessed, it does something like this:

$date = date('Y-m-d');
$id = [Page ID here];
$query = "UPDATE `hits` SET `hits` = `hits` + 1 " .
         "WHERE `id`=$id AND `date`='$date' ";

Summing up the daily totals for the last seven days then becomes rather

SELECT id, SUM(hits) AS score
  FROM hits
  WHERE date >= '[the first day of counting]'
  GROUP BY id  
  ORDER BY score DESC;  


Re: Sorting by Popularity?

Kimmo Laine wrote:
Quoted text here. Click to load it

Unless next_page.php generates PHP, the script with this include will
only get HTML.

Quoted text here. Click to load it


    if (isset($_GET['foo'])) {
      echo '<?php echo $_GET[\'foo\']; ?>';
    } else {
      echo '<?php echo \'Not available\'; ?>';

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Re: Sorting by Popularity? wrote:
Quoted text here. Click to load it

However one pleases.

Quoted text here. Click to load it

In fact, the problem has existed for several hundred years (at least
since the start of book printing).  The publishing industry, and later
the sound recording indurstry and movie/video industry all measure
popularity in a variety of ways.

Let's take movies, for example.  You can measure their popularity by
how many people have seen it the first weekend after it came out, how
many people have seen it in movie theaters, how long it's been playing
in movie theaters, how many people purchased the DVD, and how many
people rented the DVD...

Records' popularity is measured in a similar variety of ways.  You have
weekly charts that reflect "instant" popularity (current week's rating,
highest rating achieved, number of weeks the record stayed in the
chart), but you also have lifetime recognition -- the Gold (500,000
copies sold), Platinum (1,000,000 copies sold), and Diamond (10,000,000
copies sold) awards...  


Site Timeline