From 3dc84dd02d5558b7e2e9de903eac04edcd73aec7 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 12 Mar 2010 05:39:36 +0000 Subject: Output enclosing geo elements and GeoRSS xmlns in XML timelines --- lib/apiaction.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/apiaction.php') 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)) { -- cgit v1.2.3-54-g00ecf