header('Content-Type: application/json; charset=utf-8');
print '{"authorized":true}';
} else {
- common_user_error("API method not found!", $code=404);
+ common_user_error(_('API method not found!'), $code=404);
}
exit();
function end_session($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
if (!is_null($location) && strlen($location) > 255) {
- // XXX: But Twitter just truncates and runs with it. -- Zach
- header('HTTP/1.1 406 Not Acceptable');
- print "That's too long. Max notice size is 255 chars.\n";
+ // XXX: But Twitter just truncates and runs with it. -- Zach
+ $this->client_error(_('That\'s too long. Max notice size is 255 chars.'), 406, $apidate['content-type']);
exit();
}
function update_delivery_device($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function rate_limit_status($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
}
\ No newline at end of file
function create($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function destroy($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function direct_messages($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function sent($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
# had to change this from "new" to "create" to avoid PHP reserved word
function create($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function destroy($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function favorites($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function create($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function destroy($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
$user = $apidata['user'];
if ($user->isSubscribed($other)) {
- $this->client_error("Could not follow user: $other->nickname is already on your list.", 403, $apidata['content-type']);
+ $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname);
+ $this->client_error($errmsg, 403, $apidata['content-type']);
exit();
}
$result = $sub->insert();
if (!$result) {
- $this->client_error("Could not follow user: $other->nickname.", 400, $apidata['content-type']);
+ $errmsg = sprintf(_('Could not follow user: %s is already on your list.'), $other->nickname);
+ $this->client_error($errmsg, 400, $apidata['content-type']);
exit();
}
print '"ok"';
$this->end_document('json');
} else {
- common_user_error("API method not found!", $code=404);
+ common_user_error(_('API method not found!'), $code=404);
}
exit();
}
function downtime_schedule($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function follow($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
function leave($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
exit();
}
$this->show_json_timeline($notice);
break;
default:
- common_user_error("API method not found!", $code = 404);
+ common_user_error(_('API method not found!'), $code = 404);
break;
}
} else {
- common_server_error('Couldn\'t find any statuses.', $code = 503);
+ common_server_error(_('Couldn\'t find any statuses.'), $code = 503);
}
exit();
$this->show_json_timeline($notice);
break;
default:
- common_user_error("API method not found!", $code = 404);
+ common_user_error(_('API method not found!'), $code = 404);
}
exit();
$this->show_json_timeline($notice);
break;
default:
- common_user_error("API method not found!", $code = 404);
+ common_user_error(_('API method not found!'), $code = 404);
}
exit();
// as "truncated." Sending this error may screw up some clients
// that assume Twitter will truncate for them. Should we just
// truncate too? -- Zach
- $this->client_error('That\'s too long. Max notice size is 140 chars.', $code = 406, $apidata['content-type']);
+ $this->client_error(_('That\'s too long. Max notice size is 140 chars.'), $code = 406, $apidata['content-type']);
exit();
}
if ($reply) {
$reply_to = $in_reply_to_status_id;
} else {
- $this->client_error('Not found', $code = 404, $apidata['content-type']);
+ $this->client_error(_('Not found'), $code = 404, $apidata['content-type']);
exit();
}
}
$this->show_json_timeline($notices);
break;
default:
- common_user_error("API method not found!", $code = 404);
+ common_user_error(_('API method not found!'), $code = 404);
}
*/
function destroy($args, $apidata) {
+
parent::handle($args);
common_server_error("API method under construction.", $code=501);
}
*/
function featured($args, $apidata) {
parent::handle($args);
- common_server_error("API method under construction.", $code=501);
+ common_server_error(_('API method under construction.'), $code=501);
}
function get_user($id, $apidata) {
}
}
-
if (!$user) {
// XXX: Twitter returns a random(?) user instead of throwing and err! -- Zach
- $this->client_error("User not found.", 404, $apidata['content-type']);
+ $this->client_error(_('User not found.'), 404, $apidata['content-type']);
exit();
}
$this->show_twitter_json_users($twitter_user);
$this->end_document('json');
} else {
- common_user_error("API method not found!", $code = 404);
+ common_user_error(_('API method not found!'), $code = 404);
}
exit();
$this->init_twitter_atom();
break;
default:
- $this->client_error(_('Unsupported type'));
+ $this->client_error(_('Not a supported data format.'));
break;
}
$this->end_twitter_rss();
break;
default:
- $this->client_error(_('Unsupported type'));
+ $this->client_error(_('Not a supported data format.'));
break;
}
return;
$this->show_twitter_json_users($profile_array);
break;
default:
- $this->client_error(_('not a supported data format'));
+ $this->client_error(_('Not a supported data format.'));
return;
}
return;