1Net::Twitter::API(3) User Contributed Perl Documentation Net::Twitter::API(3)
2
3
4
6 Net::Twitter::API - Moose sugar for defining Twitter API methods
7
9 version 4.01043
10
12 package My::Twitter::API;
13 use Moose::Role;
14 use Net::Twitter::API;
15
16 use namespace::autoclean;
17
18 has apiurl => ( isa => 'Str', is => 'rw', default => 'http://twitter.com' );
19
20 base_url 'apiurl';
21
22 twitter_api_method friends_timeline => (
23 description => <<'',
24 Returns the 20 most recent statuses posted by the authenticating user
25 and that user's friends. This is the equivalent of /home on the Web.
26
27 aliases => [qw/following_timeline/],
28 path => 'statuses/friends_timeline',
29 method => 'GET',
30 params => [qw/since_id max_id count page/],
31 required => [],
32 returns => 'ArrayRef[Status]',
33 );
34
35 1;
36
38 This module provides some Moose sugar for defining Twitter API methods.
39 It is part of the Net-Twitter distribution on CPAN and is used by
40 "Net::Twitter::API::RESTv1_1", "Net::Twitter::API::Search", and perhaps
41 others.
42
43 It's intent is to make maintaining "Net::Twitter" as easy as possible.
44
46 base_url
47 Specifies, by name, the attribute which contains the base URL for
48 the defined API.
49
50 twitter_api_method
51 Defines a Twitter API method. Valid arguments are:
52
53 authenticate
54 Specifies whether, by default, API methods calls should
55 authenticate.
56
57 datetime_parser
58 Specifies the Date::Time::Format derived parser to use for
59 parsing and formatting date strings for the API being defined.
60
61 description
62 A string describing the method, suitable for documentation.
63
64 aliases
65 An ARRAY ref of strings containing alternate names for the
66 method.
67
68 path
69 A string containing the path part of the API URL
70
71 path_suffix
72 A string containing an additional suffix to append to the path
73 (for legacy reasons). If you want to suffix appended, pass the
74 empty string. Defaults to ".json".
75
76 method
77 A string containing the HTTP method for the call. Defaults to
78 "GET".
79
80 add_source
81 A boolean, indicating whether or not the "source" parameter
82 should be added to the API call. (The source value is assigned
83 by Twitter for registered applications.) Defaults to 0.
84
85 params
86 An ARRAY ref of strings naming all of the valid parameters.
87 Defaults to an empty ARRAY ref.
88
89 required
90 An ARRAY ref of strings naming all of the required parameters.
91 Defaults to an empty ARRAY ref.
92
93 returns
94 A string describing the return type of the API method call.
95
96 deprecated
97 A boolean indicating whether or not this API is deprecated. If
98 set to 1, code for the method will be created. This option is
99 optional, and is used by the "Net-Twitter" distribution when
100 generating documentation. It defaults to 0.
101
103 Marc Mims <marc@questright.com>
104
106 Copyright (c) 2016 Marc Mims
107
108 The Twitter API itself, and the description text used in this module
109 is:
110
111 Copyright (c) 2009 Twitter
112
113 This library is free software; you can redistribute it and/or modify it
114 under the same terms as Perl itself.
115
117 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
118 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
119 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
120 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
121 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
122 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
123 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
124 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
125 NECESSARY SERVICING, REPAIR, OR CORRECTION.
126
127 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
128 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
129 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE
130 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
131 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
132 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
133 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
134 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
135 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
136 DAMAGES.
137
138
139
140perl v5.32.0 2020-07-28 Net::Twitter::API(3)