Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated for use with Twitter API version 1.1

The search endpoint is no longer a separate URI (https://dev.twitter.com/docs/api/1.1). Everything else seems to work as expected, as long as the user authenticates. I have tested this with almost all GET endpoints, but not for any POST endpoints.
  • Loading branch information...
commit 0eac35c6b94302738ae3d951178a24bb02ee1549 1 parent 8946b2a
@aaronwaldon aaronwaldon authored
Showing with 4 additions and 7 deletions.
  1. +4 −7 EpiTwitter.php
View
11 EpiTwitter.php
@@ -18,11 +18,10 @@ class EpiTwitter extends EpiOAuth
protected $accessTokenUrl = 'https://api.twitter.com/oauth/access_token';
protected $authorizeUrl = 'https://api.twitter.com/oauth/authorize';
protected $authenticateUrl= 'https://api.twitter.com/oauth/authenticate';
- protected $apiUrl = 'http://api.twitter.com';
- protected $apiVersionedUrl= 'http://api.twitter.com';
- protected $searchUrl = 'http://search.twitter.com';
+ protected $apiUrl = 'https://api.twitter.com/1.1';
+ protected $apiVersionedUrl= 'https://api.twitter.com';
protected $userAgent = 'EpiTwitter (http://github.com/jmathai/twitter-async/tree/)';
- protected $apiVersion = '1';
+ protected $apiVersion = '1.1';
protected $isAsynchronous = false;
/* OAuth methods */
@@ -103,9 +102,7 @@ public function __call($name, $params = null/*, $username, $password*/)
private function getApiUrl($endpoint)
{
- if(preg_match('@^/search[./]?(?=(json|daily|current|weekly))@', $endpoint))
- return "{$this->searchUrl}{$endpoint}";
- elseif(!empty($this->apiVersion))
+ if (! empty($this->apiVersion))
return "{$this->apiVersionedUrl}/{$this->apiVersion}{$endpoint}";
else
return "{$this->apiUrl}{$endpoint}";
Please sign in to comment.
Something went wrong with that request. Please try again.