From: Zach Copley Date: Fri, 12 Mar 2010 05:39:36 +0000 (+0000) Subject: Output enclosing geo elements and GeoRSS xmlns in XML timelines X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3dc84dd02d5558b7e2e9de903eac04edcd73aec7;p=quix0rs-gnu-social.git Output enclosing geo elements and GeoRSS xmlns in XML timelines --- diff --git a/lib/apiaction.php b/lib/apiaction.php index b906078628..e6aaf93161 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -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)) {