summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-07-10 16:11:31 -0700
committerZach Copley <zach@controlyourself.ca>2009-07-10 16:11:31 -0700
commit5b3d4f7121cf9999edb6789a9c0214dea193fe51 (patch)
tree78b4422b34fd8abf11155bbf6f616f7effe318f7 /lib
parent49e4f958eb7ff89bfb237da9bf810a0d668104e0 (diff)
parent08d50655f3a220b1fe970b0917a6ecbcae019b04 (diff)
Merge branch 'candrews-review' into 0.8.x
* candrews-review: added group status api, located at /api/statuses/group_timeline/ID.rss
Diffstat (limited to 'lib')
-rw-r--r--lib/router.php2
-rw-r--r--lib/twitterapi.php28
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)) {