Implementing Youtube "Most Popular" list
Posted: Sun Aug 02, 2009 6:28 pm
Hello,
I am new to web development so this may seem like a very simple concept but I hope you won't criticize me too much here. =p
I am building a website right now and I wanted to implement something like the "Most Popular" list implemented in youtube.com main home page.
This is what I was thinking of.
Lets say I have 4 categories : category1, category2, category3, category4.
When a user browses through my site and clicks on a "thing" in a category, I will add that to MySQL database. If the clicked "thing" is new, create a new row for it with a "count" field, if the clicked "thing" already exists in the table, 1++ to the count.
(each "thing" will have a specific category)
When the user clicks on the homepage, retrieve the "thing" with the most number of counts for each category; then display those "things" onto the webpage.
Does this sound okay so far?? Is this a reasonable way to implement a "most popular list" ??
Also, I'm not sure how to implement the freshness of this list. I want the most popular list to reset/refresh each day or each week so that the list isn't dominated by the same "thing" each week. How would I go on to implement this ?
Any advice on anything is very much appreciated. I am new, and I am willing to learn. I just want to make sure this is the correct way of implementing such feature so that I don't have to go on and implement this the wrong way and go *facepalm* 3 months innto it.
I am new to web development so this may seem like a very simple concept but I hope you won't criticize me too much here. =p
I am building a website right now and I wanted to implement something like the "Most Popular" list implemented in youtube.com main home page.
This is what I was thinking of.
Lets say I have 4 categories : category1, category2, category3, category4.
When a user browses through my site and clicks on a "thing" in a category, I will add that to MySQL database. If the clicked "thing" is new, create a new row for it with a "count" field, if the clicked "thing" already exists in the table, 1++ to the count.
(each "thing" will have a specific category)
When the user clicks on the homepage, retrieve the "thing" with the most number of counts for each category; then display those "things" onto the webpage.
Does this sound okay so far?? Is this a reasonable way to implement a "most popular list" ??
Also, I'm not sure how to implement the freshness of this list. I want the most popular list to reset/refresh each day or each week so that the list isn't dominated by the same "thing" each week. How would I go on to implement this ?
Any advice on anything is very much appreciated. I am new, and I am willing to learn. I just want to make sure this is the correct way of implementing such feature so that I don't have to go on and implement this the wrong way and go *facepalm* 3 months innto it.