Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Substituted direct twitter api url with api_url variable which is "ht…

  • Loading branch information...
commit 235e56019e1f9e0cf693b6da5766a1a4992e04af 1 parent 0ce0647
Mikhail Pokidko authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/tweasy.js
View
10 lib/tweasy.js
@@ -116,20 +116,22 @@ Client.prototype.request = function(url, params /*, opts, cb */) {
});
}
+var api_url = "https://api.twitter.com";
+
Client.prototype.search = function(params, cb) {
this.request("http://search.twitter.com/search.json", params, cb);
}
Client.prototype.userProfile = function(params, cb) {
- this.request("http://api.twitter.com/1/users/show.json", params, cb);
+ this.request(api_url + "/1/users/show.json", params, cb);
}
Client.prototype.userTimeline = function(params, cb) {
- this.request("http://api.twitter.com/1/statuses/user_timeline.json", params, cb);
+ this.request(api_url + "/1/statuses/user_timeline.json", params, cb);
}
Client.prototype.retweet = function(id, cb) {
- this.request("http://api.twitter.com/1/statuses/retweet/"+id+".json", {},
+ this.request(api_url + "/1/statuses/retweet/"+id+".json", {},
{method:"POST"}, cb);
}
@@ -146,7 +148,7 @@ Client.prototype.updateStatus = function(status /*, params, cb */) {
if (params.annotations) {
params.annotations = JSON.stringify(params.annotations);
}
- this.request("http://api.twitter.com/1/statuses/update.json", params, {
+ this.request(api_url + "/1/statuses/update.json", params, {
rate_limit : false,
method:"POST"}, cb);
}
Please sign in to comment.
Something went wrong with that request. Please try again.