SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Jewish Juggernaut mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP Script to get Alexa Rank

    Can some one point me to some PHP Script to get Alexa Rank?

    The old stuff doesn't work.

    As
    http://alexa.com/data/details/traffi.../sitepoint.com

    No longer gives and xml response but redirect you?

    Thanks SitePoint

  2. #2
    SitePoint Member Snowblind's Avatar
    Join Date
    Nov 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was looking for a similar thing the other day. Here's one I found that works:

    abcoder.com/php/get-google-page-rank-and-alexa-rank-of-a-domain-using-php/

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Ta da!
    PHP Code:
    <?php
    $xpath 
    = new DOMXPath(@DOMDocument::loadHTMLFile(
        
    sprintf(
            
    'http://www.alexa.com/siteinfo/%s',
            
    'sitepoint.com'
        
    )
    ));
    echo 
    $xpath->query("//div[@class='data down']")->item(0)->nodeValue#1,023
    ?>
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Member Snowblind's Avatar
    Join Date
    Nov 2009
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, that is a lot easier than the method posted on abcoder.

    Thanks Anthony.

  5. #5
    Jewish Juggernaut mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Amazing! I love the Ta Da too. Next time can i get a drum roll before the tada?

    Haha

    Thanks a bunch Anthony works like a charm


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •