분류 php

Php script to fetch alexa rank

컨텐츠 정보

  • 조회 1,767 (작성일 )

본문

특정 사이트의 알렉스 순위를 확인하는 스크립트...

 

<?

$url="365ok.co.kr";

$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;

$web=(string)$xml->SD[0]->attributes()->HOST;

echo $web." has Alexa Rank ".$rank;

?> 

php