]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better param handling in hometimeline
authorEvan Prodromou <evan@status.net>
Sun, 5 Sep 2010 05:40:15 +0000 (01:40 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 7 Sep 2010 08:00:59 +0000 (04:00 -0400)
plugins/TwitterBridge/twitteroauthclient.php

index 0d27e5990d7cf48adbd5141308646409df5b6dda..5d10d8f71282efbc4a04f2d9882fae922d6edcea 100644 (file)
@@ -202,12 +202,23 @@ class TwitterOAuthClient extends OAuthClient
     {
 
         $url    = 'https://twitter.com/statuses/home_timeline.json';
-        $params = array('since_id' => $since_id,
-                        'max_id' => $max_id,
-                        'count' => $cnt,
-                        'page' => $page,
-                        'include_entities' => 1);
-        $qry    = http_build_query($params);
+
+        $params = array('include_entities' => 'true');
+
+        if (!empty($since_id)) {
+            $params['since_id'] = $since_id;
+        }
+        if (!empty($max_id)) {
+            $params['max_id'] = $max_id;
+        }
+        if (!empty($cnt)) {
+            $params['count'] = $cnt;
+        }
+        if (!empty($page)) {
+            $params['page'] = $page;
+        }
+
+        $qry = http_build_query($params);
 
         if (!empty($qry)) {
             $url .= "?$qry";