.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::Twitter::WrappedResult 3pm" .TH Net::Twitter::WrappedResult 3pm "2018-01-18" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Twitter::WrappedResult \- Wrap an HTTP response and Twitter result .SH "VERSION" .IX Header "VERSION" version 4.01043 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::Twitter; \& \& my $nt = Net::Twitter\->new( \& traits => [ qw/API::RESTv1_1 WrapResult/ ], \& %other_new_options, \& ); \& \& my $r = $nt\->verify_credentials; \& \& my $http_response = $r\->http_response; \& my $twitter_result = $r\->result; \& my $rate_limit_remaining = $r\->rate_limit_remaining; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Often, the result of a Twitter \s-1API\s0 call, inflated from the \s-1JSON\s0 body of the \&\s-1HTTP\s0 response does not contain all the information you need. Twitter includes meta data, such as rate limiting information, in \s-1HTTP\s0 response headers. This object wraps both the inflated Twitter result and the \s-1HTTP\s0 response giving the caller full access to all the meta data. It also provides accessors for the rate limit information. .SH "METHODS" .IX Header "METHODS" .ie n .IP "new(result => $twitter_result, http_response => $http_response)" 4 .el .IP "new(result => \f(CW$twitter_result\fR, http_response => \f(CW$http_response\fR)" 4 .IX Item "new(result => $twitter_result, http_response => $http_response)" Constructs an object wrapping the Twitter result and \s-1HTTP\s0 response. .IP "result" 4 .IX Item "result" Returns the Twitter \s-1API\s0 result, i.e., the decode \s-1JSON\s0 response body. .IP "http_response" 4 .IX Item "http_response" Returns the HTTP::Response object for the \s-1API\s0 call. .IP "rate_limit" 4 .IX Item "rate_limit" Returns the rate limit, per 15 minute window, for the \s-1API\s0 endpoint called. Returns undef if no suitable rate limit header is available. .IP "rate_limit_remaining" 4 .IX Item "rate_limit_remaining" Returns the calls remaining in the current 15 minute window for the \s-1API\s0 endpoint called. Returns undef if no suitable header is available. .IP "rate_limit_reset" 4 .IX Item "rate_limit_reset" Returns the Unix epoch time time of the next 15 minute window, i.e., when the rate limit will be reset, for the \s-1API\s0 endpoint called. Returns undef if no suitable header is available. .SH "AUTHOR" .IX Header "AUTHOR" Marc Mims .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright (c) 2016 Marc Mims .PP This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.