Output enclosing geo elements and GeoRSS xmlns in XML timelines

This commit is contained in:
Zach Copley 2010-03-12 05:39:36 +00:00
parent 13556e7ba9
commit 3dc84dd02d

View File

@ -491,7 +491,7 @@ class ApiAction extends Action
$this->showXmlAttachments($twitter_status['attachments']);
break;
case 'geo':
$this->showGeoRSS($value);
$this->showGeoXML($value);
break;
case 'retweeted_status':
$this->showTwitterXmlStatus($value, 'retweeted_status');
@ -539,6 +539,18 @@ class ApiAction extends Action
}
}
function showGeoXML($geo)
{
if (empty($geo)) {
// empty geo element
$this->element('geo');
} else {
$this->elementStart('geo', array('xmlns:georss' => 'http://www.georss.org/georss'));
$this->element('georss:point', null, $geo['coordinates'][0] . ' ' . $geo['coordinates'][1]);
$this->elementEnd('geo');
}
}
function showGeoRSS($geo)
{
if (!empty($geo)) {