summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-09-30 10:22:26 -0700
committerZach Copley <zach@status.net>2009-09-30 10:22:26 -0700
commite307adfbfc44e653ee2b5b94dcf7eabdc8ffe0df (patch)
tree7f9752b6a076a13f463370e40cb00844369af6ee /lib
parentf3820cc85d53c9885744deb76d4b48cd1ec8f7e9 (diff)
New actions for /statuses/friends and /statuses/followers + social graph methods
Diffstat (limited to 'lib')
-rw-r--r--lib/apiauth.php3
-rw-r--r--lib/router.php55
-rw-r--r--lib/twitterapi.php2
3 files changed, 34 insertions, 26 deletions
diff --git a/lib/apiauth.php b/lib/apiauth.php
index c1976f964..f0b4b6bf7 100644
--- a/lib/apiauth.php
+++ b/lib/apiauth.php
@@ -45,6 +45,9 @@ require_once INSTALLDIR.'/lib/twitterapi.php';
class ApiAuthAction extends TwitterapiAction
{
+
+ var $auth_user = null;
+
/**
* Does this API resource require authentication?
*
diff --git a/lib/router.php b/lib/router.php
index 91cdd2cf8..b3bb240d9 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -314,18 +314,33 @@ class Router
'id' => '[a-zA-Z0-9]+',
'format' => '(xml|json|rss|atom)'));
- $m->connect('api/statuses/home_timeline',
- array('action' => 'apifriendstimeline'));
+ $m->connect('api/statuses/friends.:format',
+ array('action' => 'ApiFriends',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/friends/:id.:format',
+ array('action' => 'ApiFriends',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/followers.:format',
+ array('action' => 'ApiFollowers',
+ 'format' => '(xml|json)'));
+
+ $m->connect('api/statuses/followers/:id.:format',
+ array('action' => 'ApiFollowers',
+ 'id' => '[a-zA-Z0-9]+',
+ 'format' => '(xml|json)'));
$m->connect('api/statuses/:method',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(update|show|friends|followers|featured)(\.(atom|rss|xml|json))?'));
+ array('method' => '(update|show|featured)(\.(atom|rss|xml|json))?'));
$m->connect('api/statuses/:method/:argument',
array('action' => 'api',
'apiaction' => 'statuses'),
- array('method' => '(show|destroy|friends|followers)'));
+ array('method' => '(show|destroy)'));
// users
@@ -380,29 +395,21 @@ class Router
// Social graph
- $m->connect('api/friends/ids/:argument',
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'friendsIDs'));
+ $m->connect('api/friends/ids/:id.:format',
+ array('action' => 'apiFriends',
+ 'ids_only' => true));
- foreach (array('xml', 'json') as $e) {
- $m->connect('api/friends/ids.'.$e,
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'friendsIDs.'.$e));
- }
+ $m->connect('api/followers/ids/:id.:format',
+ array('action' => 'apiFollowers',
+ 'ids_only' => true));
- $m->connect('api/followers/ids/:argument',
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'followersIDs'));
+ $m->connect('api/friends/ids.:format',
+ array('action' => 'apiFriends',
+ 'ids_only' => true));
- foreach (array('xml', 'json') as $e) {
- $m->connect('api/followers/ids.'.$e,
- array('action' => 'api',
- 'apiaction' => 'statuses',
- 'method' => 'followersIDs.'.$e));
- }
+ $m->connect('api/followers/ids.:format',
+ array('action' => 'apiFollowers',
+ 'ids_only' => true));
// account
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 5cf666668..6014a340e 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -24,8 +24,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
class TwitterapiAction extends Action
{
- var $auth_user;
-
/**
* Initialization.
*