Twitte...oleans(3pm)
π Twitter::API::Trait::NormalizeBooleans β Normalize Booleans π
okay so bestie, this is a Perl manual page β Twitter::API::Trait::NormalizeBooleans, living in the User Contributed Perl Documentation section (3pm). Yes the header is truncated in your terminal, that's just how manpages do, it's giving β¨dramaβ¨.
πΈ VERSION πΈ
version 1.0006 β she's a specific girlie, don't @ me π
π¦ SYNOPSIS π¦
use Twitter::API;
my $client = Twitter::API->new_with_traits(
traits => [ qw/ApiMethods NormalizeBooleans/ ],
%other_new_options
);
my ( $r, $c ) = $client->home_timeline({ trim_user => 1 });
say $c->http_request->uri;
# output:
https://api.twitter.com/1.1/statuses/home_timeline.json?trim_user=true
see how you passed 1 and the URL got true? yeah. that's her whole job. main character energy fr fr π
β¨ DESCRIPTION β¨
Twitter has a strange concept of boolean values and honestly? it's a mess. π Usually the API accepts "t", "true", or 1 for true. Sometimes it accepts "f", "false", or 0 for false. But then you get the strange cases β like the "include_email" parameter used for authorized applications by the "verify_credentials" endpoint. That one only accepts "true". Nothing else. Not even playing.
And worse?? WORSE?? For some boolean values, passing "f", "false", or 0 all work as if you passed "true". π So for those values, false means not including the parameter at all. Not false. Not zero. Just... gone. Poof. π§
So this trait attempts to normalize booleans by transforming any perl truthy value to the Twitter API's preference, "true". It transforms falsey values to "false". And then it removes false parameters that the API always treats as true. π«Ά
You're welcome. π
π AUTHOR π
Marc Mims <marc@questright.com> β thank you king π«‘
π 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. π
and that's the whole vibe, bestie β written against perl v5.32.1, dated 2021-09-11, and yes the footer got truncated too, iykyk ππ
π¦ 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