Net::T...AppAuth(3pm)
π Net::T...AppAuth(3pm) β the whole vibe β¨
okay bestie, gather round, because this is the manual page for Net::Twitter::Role::AppAuth and it's literally the OAuth2 Application Only Authentication moment. no cap. π
β¨ NAME β¨
Net::Twitter::Role::AppAuth β OAuth2 Application Only Authentication π¦
πΈ VERSION πΈ
version 4.01043 β yes that's the actual number, don't come for me π
π SYNOPSIS π
here's how you actually use it, copy-paste era:
use Net::Twitter;
my $nt = Net::Twitter->new(
traits => ['API::RESTv1_1', 'AppAuth'],
consumer_key => "YOUR-CONSUMER-KEY",
consumer_secret => "YOUR-CONSUMER-SECRET",
);
$nt->request_token;
my $tweets = $nt->user_timeline({ screen_name => 'Twitter' });
like, that's it. that's the whole entrance. π
π DESCRIPTION π
Net::Twitter::Role::OAuth is a Net::Twitter role, and what it does is serve up OAuth authentication instead of the default Basic Authentication. glow-up fr fr β¨
heads up bestie: this client only works with APIs that are compatible to OAuth authentication. so like, vibe check your API first. π
π METHODS π
authorized
True if the client has an access_token. π«Ά
but lowkey β this does not check the validity of the access token, so requests may fail if it is invalid. it's giving "trust but verify" except we're not verifying. π
request_access_token
Request an access token. Returns the token and saves it in the object. two things at once, multitasking icon behavior. π
access_token
Get or set the access token. simple. iconic. no notes. β
invalidate_token
Invalidates and clears the access_token. bye bestie π
Note: there seems to be a Twitter bug preventing this from working---perhaps a documentation bug. E.g., see: <https://twittercommunity.com/t/revoke-an-access-token-programmatically-always-getting-a-403-forbidden/1902> so yeah, that's a real link, that's a real bug, and we're just passing the info along fr fr. π
and that's the page!! written by the perl docs girlies π this was perl v5.34.0, dated 2022-06-16, from the Net::T...AppAuth(3pm) manual β mwah, slay, periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: libnet-twitter-perl 4.01043-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-twitter-perl 4.01043-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-twitter-perl 4.01043-2 Β· 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