register('listaartigos');
$cp->start();
$cp->return_data();
function listaartigos()
{
global $ret, $cp, $usuarioGeonames;
$e = explode(" ",$ret);
$url = "http://api.geonames.org/wikipediaBoundingBox?username=".$usuarioGeonames."&style=full&north=".$e[3]."&south=".$e[1]."&east=".$e[2]."&west=".$e[0]."&maxRows=20";
//echo $url;
$xml = simplexml_load_file($url."&lang=pt");
$conta = 0;
$fim = array();
$resultado = "";
foreach($xml->entry as $e)
{
$r = $e->xpath('title');
if (function_exists(mb_convert_encoding))
{$r = mb_convert_encoding($r[0],"HTML-ENTITIES","auto");}
$resultado .= "".$r." - ";
$r = $e->xpath('feature');
if (function_exists(mb_convert_encoding))
{$r = mb_convert_encoding($r[0],"HTML-ENTITIES","auto");}
$resultado .= "".$r."
";
$r = $e->xpath('summary');
if (function_exists(mb_convert_encoding))
{$r = mb_convert_encoding($r[0],"HTML-ENTITIES","auto");}
$resultado .= $r."
";
$r = $e->xpath('wikipediaUrl');
if (function_exists(mb_convert_encoding))
{$r = mb_convert_encoding($r[0],"HTML-ENTITIES","auto");}
$resultado .= "abrir Wikpedia
";
$resultado .= "