geduldig / TwitterAPI

Minimal python wrapper for Twitter's REST and Streaming APIs
936 stars 263 forks source link

Quota-aware TwitterPager class, TwitterResponse.get_quota() always returning quota info (if available) #189

Closed thiago-a-silva closed 3 years ago

thiago-a-silva commented 3 years ago

Hi, @geduldig, hope this message finds you well

Firstly, many thanks for maintaining this package! It has been very useful for one of my projects.

I'd like to propose some tweaking on the TwitterPager class to make it quota-aware so that the SLEEP period takes it into consideration, avoiding 'quota exceeded' errors. I have also made the TwitterResponse.get_quota() always return the quota info when available so it is easier to "plan ahead" on individual requests.

Any comments are appreciated.

Cheers, Thiago

thiago-a-silva commented 3 years ago

Needs additional work.