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']); $this->showXmlAttachments($twitter_status['attachments']);
break; break;
case 'geo': case 'geo':
$this->showGeoRSS($value); $this->showGeoXML($value);
break; break;
case 'retweeted_status': case 'retweeted_status':
$this->showTwitterXmlStatus($value, '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) function showGeoRSS($geo)
{ {
if (!empty($geo)) { if (!empty($geo)) {