[add laconica-specific methods to htaccess.sample
Evan Prodromou <evan@prodromou.name>**20081230202513]
[add laconica methods to unauthed ones
-Evan Prodromou <evan@prodromou.name>**20081230203747]
\ No newline at end of file
+Evan Prodromou <evan@prodromou.name>**20081230203747]
+[implement api/laconica/version method
+Evan Prodromou <evan@prodromou.name>**20081230205939]
\ No newline at end of file
*
* Returns a version number for this version of Laconica, which
* should make things a bit easier for upgrades.
+ * URL: http://identi.ca/api/laconica/version.(xml|json)
+ * Formats: xml, json
*
* @param array $args Web arguments
* @param array $apidata Twitter API data
function version($args, $apidata)
{
parent::handle($args);
- common_server_error(_('API method under construction.'), 501);
+ switch ($apidata['content-type']) {
+ case 'xml':
+ $this->init_document('xml');
+ common_element('version', null, LACONICA_VERSION);
+ $this->end_document('xml');
+ case 'json':
+ $this->init_document('json');
+ print '"'.LACONICA_VERSION.'"';
+ $this->end_document('json');
+ default:
+ $this->client_error(_('API method not found!'), $code=404);
+ }
}
/**
-hunk ./actions/api.php 120
-- 'help/downtime_schedule');
-+ 'help/downtime_schedule',
-+ 'laconica/version',
-+ 'laconica/config',
-+ 'laconica/wadl');
+hunk ./actions/twitapilaconica.php 56
++ * URL: http://identi.ca/api/laconica/version.(xml|json)
++ * Formats: xml, json
+hunk ./actions/twitapilaconica.php 70
+- common_server_error(_('API method under construction.'), 501);
++ switch ($apidata['content-type']) {
++ case 'xml':
++ $this->init_document('xml');
++ common_element('version', null, LACONICA_VERSION);
++ $this->end_document('xml');
++ case 'json':
++ $this->init_document('json');
++ print '"'.LACONICA_VERSION.'"';
++ $this->end_document('json');
++ default:
++ $this->client_error(_('API method not found!'), $code=404);
++ }
*
* Returns a version number for this version of Laconica, which
* should make things a bit easier for upgrades.
+ * URL: http://identi.ca/api/laconica/version.(xml|json)
+ * Formats: xml, json
*
* @param array $args Web arguments
* @param array $apidata Twitter API data
function version($args, $apidata)
{
parent::handle($args);
- common_server_error(_('API method under construction.'), 501);
+ switch ($apidata['content-type']) {
+ case 'xml':
+ $this->init_document('xml');
+ common_element('version', null, LACONICA_VERSION);
+ $this->end_document('xml');
+ case 'json':
+ $this->init_document('json');
+ print '"'.LACONICA_VERSION.'"';
+ $this->end_document('json');
+ default:
+ $this->client_error(_('API method not found!'), $code=404);
+ }
}
/**