Skip to content

Commit

Permalink
Merge pull request #11 from Andrew8xx8/master
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
dg committed Nov 22, 2012
2 parents cfff1d0 + 568373d commit 4cab5f6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/twitter.class.php
Expand Up @@ -15,6 +15,8 @@
*/
class Twitter
{
const API_URL = 'http://api.twitter.com/1.1/';

/**#@+ Timeline {@link Twitter::load()} */
const ME = 1;
const ME_AND_FRIENDS = 2;
Expand Down Expand Up @@ -117,7 +119,7 @@ public function send($message)
*/
public function load($flags = self::ME, $count = 20, $page = 1)
{
static $timelines = array(self::ME => 'user_timeline', self::ME_AND_FRIENDS => 'friends_timeline', self::REPLIES => 'mentions', self::ALL => 'public_timeline');
static $timelines = array(self::ME => 'user_timeline', self::ME_AND_FRIENDS => 'friends_timeline', self::REPLIES => 'mentions_timeline', self::ALL => 'public_timeline');

if (!is_int($flags)) { // back compatibility
$flags = $flags ? self::ME_AND_FRIENDS : self::ME;
Expand Down Expand Up @@ -173,10 +175,10 @@ public function destroy($id)
public function search($query, $flags = self::JSON)
{
return $this->request(
'http://search.twitter.com/search.' . self::getFormat($flags),
'/search/tweets.' . self::getFormat($flags),
is_array($query) ? $query : array('q' => $query),
'GET'
)->results;
)->statuses;
}


Expand All @@ -195,7 +197,7 @@ public function request($request, $data = NULL, $method = 'POST')
if (!strpos($request, '.')) {
$request .= '.json';
}
$request = 'http://api.twitter.com/1/' . $request;
$request = self::API_URL . $request;
}

$request = Twitter_OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $request, $data);
Expand Down

0 comments on commit 4cab5f6

Please sign in to comment.