How do I make an authenticated request?


#1

I currently have a Google script that returns the number of followers for a given username, but I’m frequently going over the 150 rate limit. How do I change my code so it makes an authenticated request?

I know very little about coding/APIs and I would really appreciate some help. Here is the code:

{
function twitterfollowers(pageid) {
var jsondata = UrlFetchApp.fetch(“http://api.twitter.com/1/users/show.json?user_id=”+pageid);
var object = Utilities.jsonParse(jsondata.getContentText());
return object.followers_count;
}
}


#2

There’s a lot more you’ll need to do then some simple code changes as you can’t perform OAuth 1.0A securely from pure client-side Javascript. Take a look at [node:114] to get started on the topic…