Is there a script that fetches alexa rankings?

Discussion in 'Programming' started by cipals15, Nov 14, 2008.

  1. #1
    I am currently developing a website. I need alexa rankings added to the set of information my website gives.

    But when i check their code. I couldn't find any script that returns the value of a certain websites rank.

    Is there anyone who developed one?
     
    cipals15, Nov 14, 2008 IP
  2. Silver89

    Silver89 Notable Member

    Messages:
    2,243
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    205
    #2
    You could use the code alexa provide, then use php or something similar to load the url of the site you want into the code.

    <!-- Alexa Graph Widget from http://www.alexa.com/site/site_stats/signup -->
    
    <script type="text/javascript"
    	src="http://widgets.alexa.com/traffic/javascript/graph.js"></script>
    
    <script type="text/javascript">/*
    <![CDATA[*/
    
       // USER-EDITABLE VARIABLES
       // enter up to 3 domains, separated by a space
       var sites      = ["mostplays.com"];
       var opts = {
          width:      380,  // width in pixels (max 400)
          height:     300,  // height in pixels (max 300)
          type:       'r',  // "r" Reach, "n" Rank, "p" Page Views
          range:      '6m', // "7d", "1m", "3m", "6m", "1y", "3y", "5y", "max"
          bgcolor:    'e6f3fc' // hex value without "#" char (usually "e6f3fc")
       };
       // END USER-EDITABLE VARIABLES
       AGraphManager.add( new AGraph(sites, opts) );
    
    //]]></script>
    
    <!-- end Alexa Graph Widget -->
    Code (markup):
    Change this line:

    var sites = ["mostplays.com"];

    To:

    var sites = ["dynamic site url here.com"];
     
    Silver89, Nov 15, 2008 IP
  3. happpy

    happpy Well-Known Member

    Messages:
    926
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    120
    #3
    i build you a alexa-rank-grabber which gets the rank into your text,
    if you want. PM me
     
    happpy, Nov 15, 2008 IP
  4. techcone

    techcone Banned

    Messages:
    206
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0