views:

48

answers:

3

I'm planning on developing my own plugin for showing the most popular posts, as well as counting how many times a post has been read.

But I need a good algorithm for figuring out the most popular blog post, and a way of counting the number of times a post has been viewed.

A problem I see when it comes to counting the number of times a post has been read, is to avoid counting if the same person opens the same post many times in a row, as well as avoiding web crawlers.

+2  A: 

http://wordpress.org/extend/plugins/wordpress-popular-posts/

Comes in the form of a plugin. No muss, no fuss.

hsatterwhite
I think I found a bette rone. Not tested yet: http://wordpress.org/extend/plugins/stats/ - it's what wordpress.com uses.
Steven
I've decided I'll use the 'Mot popular' plugin together with the 'stat' plugin from Automattic. There are so many plugins which are so and so - not finding the correct one led me to try and create my own plugin. Now I dont have to :)
Steven
+1  A: 

'Live' counters are easily implementable and a dime a dozen. If they become too cumbersome on high traffic blogs, the usual way is to parse webserver access logs on another server periodically and update the database. The period can vary from a few minutes to a day, depending on how much lag you deem acceptable.

Wrikken
+1  A: 

There are two ways of going about this:

  1. You could consider the individual page hits [through the Apache/IIS logs] and use that
  2. Use Google Page rank to emphasize pages that are strongly linked to [popular posts would no longer be based on visits but on the amount of pages that link to it]
monksy
I just read something about WP-cache - not sure what this records though.
Steven