8000 Drop support for v1 API, add statuses/sample, friendships/no_retweets… · atake/codebird-php@54d1b98 · GitHub
[go: up one dir, main page]

Skip to content

Commit 54d1b98

Browse files
committed
Drop support for v1 API, add statuses/sample, friendships/no_retweets/ids methods
1 parent 08c56b2 commit 54d1b98

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

codebird.php

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ class Codebird
7171
*/
7272
private static $_endpoint_oauth = 'https://api.twitter.com/';
7373

74-
/**
75-
* The API endpoint to use for untransitioned methods
76-
*/
77-
private static $_endpoint_old = 'https://api.twitter.com/1/';
78-
7974
/**
8075
* The Request or access token. Used to sign requests
8176
*/
@@ -492,6 +487,7 @@ private function _detectMethod($method, $params)
492487
'statuses/user_timeline',
493488
'statuses/home_timeline',
494489
'statuses/retweets_of_me',
490+
'statuses/sample',
495491

496492
// Tweets
497493
'statuses/retweets/:id',
@@ -507,6 +503,7 @@ private function _detectMethod($method, $params)
507503
'direct_messages/show',
508504

509505
// Friends & Followers
506+
'friendships/no_retweets/ids',
510507
'friends/ids',
511508
'followers/ids',
512509
'friendships/lookup',
@@ -571,10 +568,7 @@ private function _detectMethod($method, $params)
571568
'help/languages',
572569
'help/privacy',
573570
'help/tos',
574-
'application/rate_limit_status',
575-
576-
// Old
577-
'users/recommendations'
571+
'application/rate_limit_status'
578572
);
579573
$httpmethods['POST'] = array(
580574
// Tweets
@@ -664,22 +658,6 @@ private function _detectMultipart($method)
664658
return in_array($method, $multiparts);
665659
}
666660

667-
/**
668-
* Detects if API call should use the old endpoint
669-
*
670-
* @param string $method The API method to call
671-
*
672-
* @return bool Whether the method is defined in old API
673-
*/
674-
private function _detectOld($method)
675-
{
676-
$olds = array(
677-
// Users
678-
'users/recommendations'
679-
);
680-
return in_array($method, $olds);
681-
}
682-
683661
/**
684662
* Detects filenames in upload parameters
685663
*
@@ -760,8 +738,6 @@ private function _getEndpoint($method, $method_template)
760738
{
761739
if (substr($method, 0, 5) == 'oauth') {
762740
$url = self::$_endpoint_oauth . $method;
763-
} elseif ($this->_detectOld($method_template)) {
764-
$url = self::$_endpoint_old . $method . '.json';
765741
} else {
766742
$url = self::$_endpoint . $method . '.json';
767743
}

0 commit comments

Comments
 (0)
0