<?php

function getTechnorati($tag) {

// Przygotowanie żšdania
$base         = 'http://api.technorati.com/tag';
$query_string = '';

$params = array( 'key'   => '2c0b78bb8db0ec1c584c93972717b250',
                 'tag'   => $tag,
                 'limit' => '10'

);

foreach ($params as $key => $value) {
    $query_string .= "$key=" . urlencode($value) . "&";
}

$url = "$base?$query_string";

// Wykonanie żšdania za pomocš instrukcji curl
$c   = curl_init($url);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
$xml = curl_exec($c);
curl_close($c);

return $xml;
}
?>
