15 Ocak 2014 Çarşamba

PHP ile Alexa Değerlerini Almak

Tayfun Erbilen'in hazırladığı kod betiği sayesinde siteniz için hızlıca alexa değerlerini çekip listeleyebileceksiniz.



<?php

// site url
$url = 'http://www.erbilen.net';

// get data
$alexa = simplexml_load_file('http://data.alexa.com/data?cli=10&url='.$url);

// global rank
$globalRank = number_format( (int) $alexa->SD->POPULARITY['TEXT'] );

// country rank
$countryCode = $alexa->SD->COUNTRY['CODE'];
$countryName = $alexa->SD->COUNTRY['NAME'];
$countryRank = number_format( (int) $alexa->SD->COUNTRY['RANK'] );

// global rank print
print $globalRank;

print '<hr />';

// country rank print
print $countryName.' '.$countryRank;

?>

 

Share

& Comment

0 yorum:

Yorum Gönder

 

Copyright © 2015 Papiculo !™ is a registered trademark.

Designed by Templateism. Hosted on Blogger Platform.