diff -r ee6c49700601 sites/all/modules/twitter/twitter.lib.php
--- a/sites/all/modules/twitter/twitter.lib.php	Wed Oct 17 20:34:39 2012 +0800
+++ b/sites/all/modules/twitter/twitter.lib.php	Wed Oct 17 21:19:39 2012 +0800
@@ -1,6 +1,9 @@
 <?php
 // $Id: twitter.lib.php,v 1.1.2.6 2010/10/20 15:18:10 walkah Exp $
 
+define('TWITTER_API_VERSION', "1");
+define('TWITTER_API','https://api.twitter.com');
+
 /**
  * @file
  * Classes to implement the full Twitter API
@@ -267,12 +270,24 @@
       $format = $this->format;
     }
 
-    $url =  'http://'. $this->host .'/'. $path;
+    $url =  variable_get('twitter_api', TWITTER_API) . '/'. variable_get('twitter_api_version', TWITTER_API_VERSION) . '/'. $path;
     if (!empty($format)) {
       $url .= '.'. $this->format;
     }
     return $url;
   }
+
+  protected function create_url_without_version($path, $format = NULL) {
+   if (is_null($format)) {
+    $format = $this->format;
+   }
+   $url =  variable_get('twitter_api', TWITTER_API) .'/'. $path;
+   if (!empty($format)) {
+    $url .= '.'. $this->format;
+   }
+   return $url;
+   }
+
 }
 
 /**
@@ -295,7 +310,7 @@
   }
 
   public function get_request_token() {
-    $url = $this->create_url('oauth/request_token', '');
+    $url = $this->create_url_without_version('oauth/request_token', '');
     try {
       $response = $this->auth_request($url);
     }
@@ -307,21 +322,21 @@
   }
 
   public function get_authorize_url($token) {
-    $url = $this->create_url('oauth/authorize', '');
+    $url = $this->create_url_without_version('oauth/authorize', '');
     $url.= '?oauth_token=' . $token['oauth_token'];
 
     return $url;
   }
 
   public function get_authenticate_url($token) {
-    $url = $this->create_url('oauth/authenticate', '');
+    $url = $this->create_url_without_version('oauth/authenticate', '');
     $url.= '?oauth_token=' . $token['oauth_token'];
 
     return $url;
   }
 
   public function get_access_token() {
-    $url = $this->create_url('oauth/access_token', '');
+    $url = $this->create_url_without_version('oauth/access_token', '');
     try {
       $response = $this->auth_request($url);
     }
