@@ -70,11 +70,6 @@ class Codebird
70
70
*/
71
71
private $ _endpoint_old = 'https://api.twitter.com/1/ ' ;
72
72
73
- /**
74
- * The API endpoint to use for internal requests
75
- */
76
- private $ _endpoint_internal = 'https://api.twitter.com/i/ ' ;
77
-
78
73
/**
79
74
* The Request or access token. Used to sign requests
80
75
*/
@@ -103,7 +98,7 @@ class Codebird
103
98
/**
104
99
* The current Codebird version
105
100
*/
106
- private $ _version = '2.2.2-internal ' ;
101
+ private $ _version = '2.2.3 ' ;
107
102
108
103
/**
109
104
* Returns singleton class instance
@@ -240,12 +235,11 @@ public function __call($fn, $params)
240
235
241
236
$ httpmethod = $ this ->_detectMethod ($ method_template , $ apiparams );
242
237
$ multipart = $ this ->_detectMultipart ($ method_template );
243
- $ internal = $ this ->_detectInternal ($ method_template );
244
238
245
239
// geek-geek: Now allowing to specify filenames as params
246
240
$ this ->_detectFilenames ($ method_template , $ apiparams );
247
241
248
- return $ this ->_callApi ($ httpmethod , $ method , $ method_template , $ apiparams , $ multipart, $ internal );
242
+ return $ this ->_callApi ($ httpmethod , $ method , $ method_template , $ apiparams , $ multipart );
249
243
}
250
244
251
245
/**
@@ -451,6 +445,7 @@ private function _detectMethod($method, $params)
451
445
'statuses/mentions_timeline ' ,
452
446
'statuses/user_timeline ' ,
453
447
'statuses/home_timeline ' ,
448
+ 'statuses/retweets_of_me ' ,
454
449
455
450
// Tweets
456
451
'statuses/retweets/:id ' ,
@@ -484,6 +479,7 @@ private function _detectMethod($method, $params)
484
479
'users/contributees ' ,
485
480
'users/contributors ' ,
486
481
'users/recommendations ' ,
482
+ 'users/profile_banner ' ,
487
483
488
484
// Suggested Users
489
485
'users/suggestions/:slug ' ,
@@ -528,17 +524,7 @@ private function _detectMethod($method, $params)
528
524
'help/languages ' ,
529
525
'help/privacy ' ,
530
526
'help/tos ' ,
531
- 'application/rate_limit_status ' ,
532
-
533
- // Internal
534
- 'activity/about_me ' ,
535
- 'activity/by_friends ' ,
536
- 'search/typeahead ' ,
537
- 'statuses/:id/activity/summary ' ,
538
-
539
- // Not authorized as of 2012-10-17
540
- 'discovery ' ,
541
- 'resolve '
527
+ 'application/rate_limit_status '
542
528
);
543
529
$ httpmethods ['POST ' ] = array (
544
530
// Tweets
@@ -563,8 +549,8 @@ private function _detectMethod($method, $params)
563
549
'account/update_profile_background_image ' ,
564
550
'account/update_profile_colors ' ,
565
551
'account/update_profile_image ' ,
566
- 'account/update_profile_banner ' ,
567
552
'account/remove_profile_banner ' ,
553
+ 'account/update_profile_banner ' ,
568
554
'blocks/create ' ,
569
555
'blocks/destroy ' ,
570
556
@@ -637,34 +623,11 @@ private function _detectOld($method)
637
623
{
638
624
$ olds = array (
639
625
// Users
640
- 'account/update_profile_banner ' ,
641
- 'account/remove_profile_banner ' ,
642
626
'users/recommendations '
643
627
);
644
628
return in_array ($ method , $ olds );
645
629
}
646
630
647
- /**
648
- * Detects if API call should use internal endpoint
649
- *
650
- * @param string $method The API method to call
651
- *
652
- * @return bool Whether the method is defined in internal API
653
- */
654
- private function _detectInternal ($ method )
655
- {
656
- $ internals = array (
657
- // Activity
658
- 'activity/about_me ' ,
659
- 'activity/by_friends ' ,
660
- 'discovery ' ,
661
- 'search/typeahead ' ,
662
- 'statuses/:id/activity/summary ' ,
663
- 'resolve '
664
- );
665
- return in_array ($ method , $ internals );
666
- }
667
-
668
631
/**
669
632
* Detects filenames in upload parameters
670
633
*
@@ -747,8 +710,6 @@ private function _getEndpoint($method, $method_template)
747
710
$ url = $ this ->_endpoint_oauth . $ method ;
748
711
} elseif ($ this ->_detectOld ($ method_template )) {
749
712
$ url = $ this ->_endpoint_old . $ method . '.json ' ;
750
- } elseif ($ this ->_detectInternal ($ method_template )) {
751
- $ url = $ this ->_endpoint_internal . $ method . '.json ' ;
752
713
} else {
753
714
$ url = $ this ->_endpoint . $ method . '.json ' ;
754
715
}
@@ -763,20 +724,15 @@ private function _getEndpoint($method, $method_template)
763
724
* @param string $method_template The templated API method to call
764
725
* @param array optional $params The parameters to send along
765
726
* @param bool optional $multipart Whether to use multipart/form-data
766
- * @param bool optional $internal Whether to use internal API
767
727
*
768
728
* @return mixed The API reply, encoded in the set return_format
769
729
*/
770
730
771
- private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false , $ internal = false )
731
+ private function _callApi ($ httpmethod , $ method , $ method_template , $ params = array (), $ multipart = false )
772
732
{
773
733
if (! function_exists ('curl_init ' )) {
774
734
throw new Exception ('To make API requests, the PHP curl extension must be available. ' );
775
735
}
776
- if ($ internal ) {
777
- $ params ['adc ' ] = 'phone ' ;
778
- $ params ['application_id ' ] = 333903271 ;
779
- }
780
736
$ url = $ this ->_getEndpoint ($ method , $ method_template );
781
737
$ ch = false ;
782
738
if ($ httpmethod == 'GET ' ) {
0 commit comments