Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
aaronwaldon committed Feb 19, 2013
1 parent 8946b2a commit 0eac35c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions EpiTwitter.php
Expand Up @@ -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 */
Expand Down Expand Up @@ -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}";
Expand Down

0 comments on commit 0eac35c

Please sign in to comment.