3 * Laconica, the distributed open-source microblogging tool
5 * Laconica-only extensions to the Twitter-like API
9 * LICENCE: This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License as published by
11 * the Free Software Foundation, either version 3 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Affero General Public License for more details.
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 * @author Evan Prodromou <evan@controlyourself.ca>
25 * @copyright 2008 Control Yourself, Inc.
26 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
27 * @link http://laconi.ca/
30 if (!defined('LACONICA')) {
34 require_once INSTALLDIR.'/lib/twitterapi.php';
37 * Laconica-specific API methods
39 * This class handles all /laconica/ API methods.
43 * @author Evan Prodromou <evan@controlyourself.ca>
44 * @copyright 2008 Control Yourself, Inc.
45 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
46 * @link http://laconi.ca/
49 class TwitapilaconicaAction extends TwitterapiAction
52 * A version stamp for the API
54 * Returns a version number for this version of Laconica, which
55 * should make things a bit easier for upgrades.
56 * URL: http://identi.ca/api/laconica/version.(xml|json)
59 * @param array $args Web arguments
60 * @param array $apidata Twitter API data
64 * @see ApiAction::process_command()
67 function version($args, $apidata)
69 parent::handle($args);
70 switch ($apidata['content-type']) {
72 $this->init_document('xml');
73 common_element('version', null, LACONICA_VERSION);
74 $this->end_document('xml');
77 $this->init_document('json');
78 print '"'.LACONICA_VERSION.'"';
79 $this->end_document('json');
82 $this->client_error(_('API method not found!'), $code=404);
87 * Dump of configuration variables
89 * Gives a full dump of configuration variables for this instance
90 * of Laconica, minus variables that may be security-sensitive (like
93 * @param array $args Web arguments
94 * @param array $apidata Twitter API data
98 * @see ApiAction::process_command()
101 function config($args, $apidata)
103 parent::handle($args);
104 common_server_error(_('API method under construction.'), 501);
108 * WADL description of the API
110 * Gives a WADL description of the API provided by this version of the
113 * @param array $args Web arguments
114 * @param array $apidata Twitter API data
118 * @see ApiAction::process_command()
121 function wadl($args, $apidata)
123 parent::handle($args);
124 common_server_error(_('API method under construction.'), 501);