Twitte...imiting(3pm)
π NAME π
Twitter::API::Trait::RateLimiting β the trait that just auto-naps for you when the API says "girl, slow down." No cap, it handles rate limiting so you don't have to.
β¨ VERSION β¨
version 1.0006 π
πΈ SYNOPSIS πΈ
use Twitter::API;
my $client = Twitter::API->new_with_options(
traits => [ qw/ApiMethods RateLimiting/ ],
%other_options,
);
# Use $client as normal
π¦ DESCRIPTION π¦
okay so bestie, here's the tea π΅: Twitter's API does its rate limiting inside a 15-minute window, and if you blow past the limit for a window, it just serves you up an HTTP 429 error. rude, honestly.
Applying this trait gives Twitter::API the power to automatically sleep for as long as it needs to, and then retry the request β instead of just throwing an exception at you like some drama queen. it's giving considerate π
π ATTRIBUTES π
π rate_limit_sleep_code
A coderef π«Ά β it gets called to actually do the sleeping. It takes a single parameter: the number of seconds to sleep.
The default implementation is iconic and tiny:
sub { sleep shift }
π SEE ALSO π
<https://developer.twitter.com/en/docs/basics/rate-limiting>
π AUTHOR π
Marc Mims <marc@questright.com> π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2015-2021 by Marc Mims.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
π« that's the whole page, bestie. this doc was living inperl v5.32.1territory, dated2021-09-11β shoutout to the User Contributed Perl Documentation crew for keeping the vibe alive. mwah, bye π§π
π¦ where this page comes from
- debian bookworm: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtwitter-api-perl 1.0006-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms