Created
July 6, 2012 17:55
-
-
Save kubrick06010/3061627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use Net::Twitter; | |
| $nt = Net::Twitter->new( | |
| traits => ['API::REST', 'RetryOnError'] | |
| max_retries => 3, | |
| ); | |
| use Net::Twitter; | |
| my $nt = Net::Twitter->new( | |
| traits => [qw/API::REST RateLimit/], | |
| %other_options, | |
| ); | |
| #...later | |
| sleep $nt->until_rate(1.0) || $minimum_wait; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Twitter API only allows clients to make a limited number of calls in a given hour. This policy affects the APIs in different ways.
REST API Rate Limiting
The default rate limit for calls to the REST API varies depending on the authorization method being used and whether the method itself requires authentication.