【问题标题】:How to get country wise alexa rank of a website using php?如何使用 php 获得网站在国家/地区的 alexa 排名?
【发布时间】:2017-06-21 21:38:43
【问题描述】:

我想使用 PHP 或 JAVASCRIPT 获得特定网站的国家/地区 Alexa 排名。

谁能帮帮我?

【问题讨论】:

    标签: alexa


    【解决方案1】:
    <?php
        $url='google.com.sg';
        $xml = simplexml_load_file('http://data.alexa.com/data?cli=10&dat=snbamz&url='.$url);
        $rank=isset($xml->SD[1]->POPULARITY)?$xml->SD[1]->POPULARITY->attributes()->TEXT:0;
        $country_rank=isset($xml->SD[1]->COUNTRY)?$xml->SD[1]->COUNTRY->attributes()->RANK:0;
        $web=(string)$xml->SD[0]->attributes()->HOST;
        echo $web." has Alexa Rank ".$rank." and Country Rank ".$country_rank.".\n";
    ?>
    

    结果是

    google.com.sg 的 Alexa 排名第 282 位,国家/地区排名第 2。

    改编自here

    【讨论】:

      【解决方案2】:

      你可以使用这个http://aws.amazon.com/code/AWIS/402

      UrlInfo 有一个名为 RankByCountry 的响应组,它应该可以解决您的目的。在此处查找详细信息:http://docs.aws.amazon.com/AlexaWebInfoService/latest/

      【讨论】:

        猜你喜欢
        • 2022-07-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-09-28
        • 1970-01-01
        • 2013-11-05
        相关资源
        最近更新 更多