Net::T...er::API(3pm)
π Net::Twitter::API π
okay bestie, you found the manual page for Net::Twitter::API (that's the 3pm one, perl module docs, iykyk) β and ngl it's a little gem. it's Moose sugar for defining Twitter API methods, and yes that's the whole vibe. pull up a chair, grab a boba, let's go π§β¨
β¨ VERSION β¨
version 4.01043 β that's the one, that's the version, no notes π
π SYNOPSIS π
okay so here's how you actually use this thing. watch and learn:
package My::Twitter::API;
use Moose::Role;
use Net::Twitter::API;
use namespace::autoclean;
has apiurl => ( isa => 'Str', is => 'rw', default => 'http://twitter.com' );
base_url 'apiurl';
twitter_api_method friends_timeline => (
description => <<'',
Returns the 20 most recent statuses posted by the authenticating user
and that user's friends. This is the equivalent of /home on the Web.
aliases => [qw/following_timeline/],
path => 'statuses/friends_timeline',
method => 'GET',
params => [qw/since_id max_id count page/],
required => [],
returns => 'ArrayRef[Status]',
);
1;
likeβ¦ it's giving declarative. it's giving clean. we love to see it π
π¦ DESCRIPTION π¦
so basically, this module hands you some Moose sugar for defining Twitter API methods. that's the whole job. it lives inside the Net-Twitter distribution on CPAN, and it's the thing that Net::Twitter::API::RESTv1_1, Net::Twitter::API::Search, and honestly maybe some other little guys are built on top of.
its whole intent β and this is a direct quote from the vibes β is to make maintaining Net::Twitter as easy as possible. iconic behavior, honestly π
π METHODS π
πΈ base_url
Specifies, by name, the attribute which contains the base URL for the defined API.
like you don't hand it a URL, you hand it the name of the attribute that's holding the URL. naming your source of truth? very demure, very mindful π«Ά
π twitter_api_method
Defines a Twitter API method. and ooh girl, there are a LOT of valid arguments. here's the full list, no skips, no shortcuts:
authenticateβ Specifies whether, by default, API methods calls should authenticate. (yes, the original really does say "methods calls". we're keeping it, it's canon π)datetime_parserβ Specifies theDate::Time::Formatderived parser to use for parsing and formatting date strings for the API being defined.descriptionβ A string describing the method, suitable for documentation.aliasesβ AnARRAYref of strings containing alternate names for the method. aka the method's many nicknames, its government name AND its stage name β¨pathβ A string containing the path part of the API URL.path_suffixβ A string containing an additional suffix to append to the path (for legacy reasons). If you want to suffix appended, pass the empty string. Defaults to".json". (legacy reasons, bestie. we don't ask. we just respect it.)methodβ A string containing the HTTP method for the call. Defaults to"GET".add_sourceβ A boolean, indicating whether or not the"source"parameter should be added to the API call. (The source value is assigned by Twitter for registered applications.) Defaults to0.paramsβ AnARRAYref of strings naming all of the valid parameters. Defaults to an emptyARRAYref.requiredβ AnARRAYref of strings naming all of the required parameters. Defaults to an emptyARRAYref.returnsβ A string describing the return type of the API method call.deprecatedβ A boolean indicating whether or not this API is deprecated. If set to1, code for the method will be created. This option is optional, and is used by the"Net-Twitter"distribution when generating documentation. It defaults to0.
ok real talk:deprecatedis a real flag and it really does still generate the code when you set it to1β so don't go assuming "deprecated" means "gone", because it does not π read it before you yeet it.
π AUTHOR π
Marc Mims <marc@questright.com> β the legend, the moment, the whole entire author π
π LICENSE π
Copyright (c) 2016 Marc Mims
The Twitter API itself, and the description text used in this module is:
Copyright (c) 2009 Twitter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source queen π
π«Ά DISCLAIMER OF WARRANTY π«Ά
okay this part is the legal screaming section, and it is SCREAMING in all caps, so buckle up. we're keeping every word because the facts do not change, only the vibe:
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
translation bestie: it's free, it comes as-is, and if it breaks it is not their problem. periodt. π
and that's the whole page!! this doc was generated by perl v5.34.0 on 2022-06-16, and you read it via Net::T...er::API(3pm) β yes the header truncates the name like that, it's not a typo, it's just perl being perl. mwah, go build something cute πβ¨
π¦ 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