diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-07-10 17:00:27 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-10 17:00:27 -0400 |
commit | 08d50655f3a220b1fe970b0917a6ecbcae019b04 (patch) | |
tree | 27bdaa7bdfd9274a2983bcc2b2d9796c92f1bff7 /lib | |
parent | bafa1ab1c532118e2230df50ed18a1b4573692b7 (diff) |
added group status api, located at /api/statuses/group_timeline/ID.rss
http://laconi.ca/trac/ticket/1702
Diffstat (limited to 'lib')
-rw-r--r-- | lib/router.php | 2 | ||||
-rw-r--r-- | lib/twitterapi.php | 28 |
2 files changed, 29 insertions, 1 deletions
diff --git a/lib/router.php b/lib/router.php index 75e72f932..bc063038f 100644 --- a/lib/router.php +++ b/lib/router.php @@ -266,7 +266,7 @@ class Router $m->connect('api/statuses/:method/:argument', array('action' => 'api', 'apiaction' => 'statuses'), - array('method' => '(user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)')); + array('method' => '(group_timeline|user_timeline|friends_timeline|replies|mentions|show|destroy|friends|followers)')); // users diff --git a/lib/twitterapi.php b/lib/twitterapi.php index f48513e67..d2515070d 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -774,6 +774,34 @@ class TwitterapiAction extends Action } } + function get_group($id, $apidata=null) + { + if (empty($id)) { + + if (is_numeric($this->arg('id'))) { + return User::staticGet($this->arg('id')); + } else if ($this->arg('id')) { + $nickname = common_canonical_nickname($this->arg('id')); + return User_group::staticGet('nickname', $nickname); + } else if ($this->arg('user_id')) { + // This is to ensure that a non-numeric user_id still + // overrides screen_name even if it doesn't get used + if (is_numeric($this->arg('user_id'))) { + return User_group::staticGet('id', $this->arg('user_id')); + } + } else if ($this->arg('screen_name')) { + $nickname = common_canonical_nickname($this->arg('screen_name')); + return User::staticGet('nickname', $nickname); + } + + } else if (is_numeric($id)) { + return User_group::staticGet($id); + } else { + $nickname = common_canonical_nickname($id); + return User_group::staticGet('nickname', $nickname); + } + } + function get_profile($id) { if (is_numeric($id)) { |