Closed dylancaponi closed 3 years ago
What is the scenario where you are making numerous calls to Twitter for the bearer token?
Well, I think it's called every time that TwitterAPI is instantiated with:
api = TwitterAPI(...)
So I'm not making numerous calls during a single run, but if I run a single job every 15 minutes that's 96 extra calls to Twitter per day that I don't need to be making. One potential source of failure when it could just be loaded from local secrets.
A recent example of why we try to reduce calls anywhere possible: We had an issue with Google where we were calling get_bucket
which actually queries the API to see if the bucket exists, instead of just Bucket
to instantiate the bucket by name and after removing that one extra call we cut our 503, 504 errors in half.
With is feature, I think, the number of requests you will be reducing is trivial. The number of errors you will be reducing, in my experience, will also be trivial.
However, adding a bearer_token
param should not be a problem. Check back in about a week.
I agree this is lowest priority and realized that many fields still require oauth1.0a which does not use bearer token.
Closing until there is a strong case for this enhancement.
Bearer Token is available in the twitter developer portal and does not change unless regenerated or revoked.
My understanding is that TwitterAPI currently gets that here.
However, I would like to add an optional
bearer_token
param to the API instantiation in order to reduce the number of calls being made to TwitterAPI and thus reduce the number of failed requests.Please let me know if you have advice on how to approach this.