Rate limit exceeded

nico18075
@nico18075 Nico18075

Hi,

I created a Google speadsheet that use a script to update the information (name, id, friends_count...) of a list of Twitter accounts.

It worked a few days ago but now i always get the following message, even after some days : Error code 400 "Rate limit exceeded. Clients may not make more than 20000 requests per hour."

Is it possible that i was "blacklisted" ?

Thanks

The script :

  1. function UpdateUserInformation(){
  2.  
  3.   var doc = SpreadsheetApp.getActiveSpreadsheet();
  4.   var sheet = doc.getActiveSheet();
  5.   var users = sheet.getRange('B2:B'+sheet.getLastRow().toString()).getValues(); //sheet.getActiveRange().getValues();
  6.   var user1='';
  7.   var user2='';
  8.  
  9.   var oauthConfig = UrlFetchApp.addOAuthService("twitter");
  10.   oauthConfig.setAccessTokenUrl("https://api.twitter.com/oauth/access_token");
  11.   oauthConfig.setRequestTokenUrl("https://api.twitter.com/oauth/request_token");
  12.   oauthConfig.setAuthorizationUrl("https://api.twitter.com/oauth/authorize");
  13.   oauthConfig.setConsumerKey('XXX');
  14.   oauthConfig.setConsumerSecret('XXX'); 
  15.  
  16.  var ligne=2;
  17.  
  18.  for (var uic=0; uic<users.length; uic++){
  19.     user1=users[uic].toString().toLowerCase();
  20.  
  21.     var url='http://api.twitter.com/1/users/show.json?screen_name='+user1;
  22.     var response = UrlFetchApp.fetch(url, {method:'get'});
  23.     if (response.getResponseCode() == 200) {
  24.       var json = Utilities.jsonParse(response.getContentText());      
  25.       sheet.getRange("C"+ligne).setValue(json['name']);
  26.       sheet.getRange("D"+ligne).setValue(json['id']);
  27.       sheet.getRange("E"+ligne).setValue(json['friends_count']);
  28.       sheet.getRange("F"+ligne).setValue(json['followers_count']);
  29.       sheet.getRange("G"+ligne).setValue(json['listed_count']);
  30.       sheet.getRange("H"+ligne).setValue(json['statuses_count']);
  31.       sheet.getRange("I"+ligne).setValue(json['created_at']);
  32.       ligne=ligne+1;  
  33.  
  34.     }
  35.   }       
  36. Browser.msgBox('MAJ des comptes terminée');    
  37. }
2 years 30 weeks ago

Replies

nico18075
@nico18075 Nico18075

Someone can help me ?

Thanks

2 years 28 weeks ago
kurrik
@kurrik Arne Roomann-Kurrik

Is this apps script? It would appear that Google's servers have hit their quota limit.

2 years 28 weeks ago