Accessing geo-nick with Pear XML_RPC2

Here you will find another version using PEAR's XML_RPC2 package.

It also converts the values returned into a RDF xml:

<?php
/**
*   Fetches php-gtk2 user data from www.php-gtk.eu
*/
require_once 'XML/RPC2/Client.php';

$options = array(
   
'prefix' => 'gtkphpnet.'
);

$client = XML_RPC2_Client::create('http://www.php-gtk.eu/xmlrpc.php', $options);

try {
   
$arUsersCount = $client->active_users();
   
$nUsers = $arUsersCount['geo-nick'];
   
$nCurrentCount = 0;
   
$nStepSize = 10;
   
$result = array();
   
$strLastNick = '';
    do {
       
$result = array_merge($result, $client->geo_nick($strLastNick, $nStepSize));
       
end($result);
       
$strLastNick = key($result);
       
$nCurrentCount += $nStepSize;
    } while (
$nCurrentCount < $nUsers);

   
$xml = <<<EOD
<?xml version="1.0" encoding="utf-8"? >
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
        xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns="http://xmlns.com/foaf/0.1/">
EOD;
    foreach (
$result as $strName => $arPerson) {
       
$xml .= '<Person>
<name>'
. $strName . '</name>
<based_near geo:lat="' 
. $arPerson[0] . '" geo:long="' . $arPerson[1] . '"/>
</Person>
'
;
    }
   
$xml .= '</rdf:RDF>' . "\n";

    echo
$xml;
} catch (
XML_RPC2_FaultException $e) {
    die(
'Exception #' . $result->getFaultCode() . ' : ' . $e->getFaultString());
} catch (
Exception $e) {
    die(
'Exception : ' . $e->getMessage());
}
?>