Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from Andrew8xx8/master

Some fixes
  • Loading branch information...
commit 4cab5f63f15995e49d33b2b1f99392ab1f235bd0 2 parents cfff1d0 + 568373d
@dg authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 library/twitter.class.php
View
10 library/twitter.class.php
@@ -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;
@@ -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;
@@ -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;
}
@@ -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);

0 comments on commit 4cab5f6

Please sign in to comment.
Something went wrong with that request. Please try again.