<?php
 require("./wbs.php");

 $wbs = new wbs_Account();
 $wbs->setUserEmail('souti@free.fr');
 $wbs->setUserPassword('setaou');

 $usersList = $wbs->getUsersList();
 foreach ($usersList as $user) {
 if ($user->getFullname() == "Delacotte, Jérôme") {
 $user->setLimit(3);
 $measuresgroups = $user->getMeasures();
 $name=substr($user->getFullname(),0,strlen($user->getFullname()));
 foreach($measuresgroups as $group) {
    $ligne="";
 $ligne=$ligne.date('Y-m-d', $group->getDate()) . ",";
 $ligne=$ligne.date('H:i:s', $group->getDate()) . ",";
 foreach($group->getMeasures() as $measure) {
 $balise=str_replace(" ","-",$measure->getUnitPrefix());
 $ligne.=$measure->getValue();
 $ligne.=",".$measure->getUnitSuffix().",";
 }
 if (strpos($ligne,"unknown") == false) { 
 print $ligne."\n";
 }
 }
 }
 }


