*/
class TwitapistatusesAction extends TwitterapiAction {
+ function is_readonly() {
+
+ static $write_methods = array( 'update',
+ 'destroy');
+
+ $cmdtext = explode('.', $this->arg('method'));
+
+ if (in_array($cmdtext[0], $write_methods)) {
+ return false;
+ }
+
+ return true;
+ }
+
function public_timeline($args, $apidata) {
parent::handle($args);
-
+
$sitename = common_config('site', 'name');
$siteserver = common_config('site', 'server');
$title = sprintf(_("%s public timeline"), $sitename);
$id = "tag:$siteserver:Statuses";
$link = common_root_url();
- $subtitle = sprintf(_("%s updates from everyone!"), $sitemap);
+ $subtitle = sprintf(_("%s updates from everyone!"), $sitename);
// Number of public statuses to return by default -- Twitter sends 20
$MAX_PUBSTATUSES = 20;
$link = common_local_url('all', array('nickname' => $user->nickname));
$subtitle = sprintf(_("Updates from %s and friends on %s!"), $user->nickname, $sitename);
- list($cnt, $notice) = $user->noticesWithFriends(($page-1)*20, $count);
+ $notice = $user->noticesWithFriends(($page-1)*20, $count);
switch($apidata['content-type']) {
case 'xml':
$user = $apidata['user'];
+ $this->is_readonly();
+
+
$notice = DB_DataObject::factory('notice');
$notice->profile_id = $user->id; # user id *is* profile id
}
$notice->rendered = common_render_content($notice->content, $notice);
-
+ $notice->is_local = 1;
+
$id = $notice->insert();
if (!$id) {