PDA

View Full Version : Alexa Ranking


WOA
10-17-2005, 05:50 PM
Hi there!

I don't want to put reciprocal links on my visitors sites. So I decided to Sort sites by Alexa Ranking.
Just wondering if anyone has this script or knows how to do this?

Thanks.

richm
11-11-2005, 12:01 AM
This link might help (getting alexa data with php):
http://speedycode.com/archives/19-Get-Alexa-Traffic-Rank-with-PHP-via-the-Amazon-Api.html

If you code this, please post your code/changes.

richm
11-11-2005, 09:18 AM
I have been working on adding Alexa rank to the directory. I haven’t implemented it yet, but here is my procedure for gathering the rank and displaying it below the description. Since I have no PHP programming experience and have never submitted a mod, I thought I would put this out there for feedback. Anybody want to work through this with me? Am I missing anything?

The source of my info on accessing Alexa via PHP came from:
http://speedycode.com/archives/19-Get-Alexa-Traffic-Rank-with-PHP-via-the-Amazon-Api.html

Content visible to registered users only.

Alexa allows you to gather 10,000 of these requests per month. Therefore, we would also benefit from a piece of code that would go through the entire link table and update the alexa rank field. I could imagine running this update monthly.

Nobody
11-11-2005, 04:10 PM
Content visible to registered users only.

Similar to how the PageRank is shown in php Link Directory, maybe even the Alexa Rank should be chached, according to the 10 000 requests per month limit.

richm
11-11-2005, 06:27 PM
It first occured to me that we could do these lookups live for each record, but many sites would bump into that 10,000 record limit pretty quickly (at 20 records per page, that would be 500 page views), and it would slow the display down pretty signficantly.

The solution above saves the page view in a field at time of entry or update. If the database is bigger than 10K records, and you wanted to update it monthly, you could probably use the date modified field to decide which records to modify, and only update the oldest 9000 each month (allowing you 1000 new and manually updated records). Also, the update program could use two or more keys to get through the entire database, although that would probably violate some Alexa use clause.

It occurs to me that this might be the solution for updating page rank, a program which goes through the database slowly (one record every six seconds) updating the oldest X records, something that could be saved as a chrontab like update_pagerank.php?rec=100. You could set it to run daily or weekly, chosing a pace that would update all of your records every 60 days or so.

The following code will add an "Alexa Rank" link to the sort options, and should probably be incorporated into the mod above.

Content visible to registered users only.

The original request in this thread was for default sorting on alexa rank. I think the solution is to add AlexaRank to the possible choices in "Default link sorting," which would allow people to choose this in the admin setup screens:

Content visible to registered users only.

Also, you may need to modify the following line in index.php, but I am not certain as I haven't really looked at it:
if(!ENABLE_PAGERANK || !SHOW_PAGERANK && $sort == 'P')

For those who are working on the Rating Mod, I also would like to see "Rating" added as a default sorting option through the admin panel.

My mod is done as an extension to PageRank, but I realize that some might do this as a replacement for pagerank should their server be blocked.

richm
11-11-2005, 07:24 PM
I just realized that my last post about coding for sort order isn't enough. I know that the sort order for Hits and PR is high-low, which would not work for AlexaRank, where the lower numbers are better scores. Therefore, this would also need to be changed.

I think this piece of code goes hand-in-hand with the mod to add thumbshots, which requires that Alexa be linked. Ideally, my implementation will include the thumbshot on the left, and below each description, something like:
(PR: 5, Alexa: 1223, Hits: 14, Rating: 9.9, Votes: 12) Rate it

The thumbshot mod is at:
http://www.phplinkdirectory.com/forum/viewtopic.php?t=1125

The rating mod is at:
http://www.phplinkdirectory.com/forum/viewtopic.php?t=194

bobby9101
03-30-2006, 08:48 PM
sorry that this is so old, but could anyone work on a more effecient version of this?
I would like to implement this into my site, however I do not believe it is running at 100% yet :-D