diff options
author | Zach Copley <zach@status.net> | 2010-03-12 05:39:36 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-12 05:39:36 +0000 |
commit | 3dc84dd02d5558b7e2e9de903eac04edcd73aec7 (patch) | |
tree | ca1fd0b472f3ebb7e577ec31b7be280e5effee37 /lib/apiaction.php | |
parent | 13556e7ba967c4184009688348082fed1480a5d4 (diff) |
Output enclosing geo elements and GeoRSS xmlns in XML timelines
Diffstat (limited to 'lib/apiaction.php')
-rw-r--r-- | lib/apiaction.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/apiaction.php b/lib/apiaction.php index b90607862..e6aaf9316 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)) { |