Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Net::Twitter::WrappedResult

Name Net::Twitter::WrappedResult
Version 4.01043
Located at /usr/share/perl5
File /usr/share/perl5/Net/Twitter/WrappedResult.pm
Is Core No
Search CPAN for this module Net::Twitter::WrappedResult
Documentation Net::Twitter::WrappedResult
Module Details Net::Twitter::WrappedResult

NAME

Net::Twitter::WrappedResult - Wrap an HTTP response and Twitter result


VERSION

version 4.01043


SYNOPSIS

    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;


DESCRIPTION

Often, the result of a Twitter API call, inflated from the JSON body of the HTTP response does not contain all the information you need. Twitter includes meta data, such as rate limiting information, in HTTP response headers. This object wraps both the inflated Twitter result and the HTTP response giving the caller full access to all the meta data. It also provides accessors for the rate limit information.


METHODS

new(result => $twitter_result, http_response => $http_response)
Constructs an object wrapping the Twitter result and HTTP response.

result
Returns the Twitter API result, i.e., the decode JSON response body.

http_response
Returns the the HTTP::Response manpage object for the API call.

rate_limit
Returns the rate limit, per 15 minute window, for the API endpoint called. Returns undef if no suitable rate limit header is available.

rate_limit_remaining
Returns the calls remaining in the current 15 minute window for the API endpoint called. Returns undef if no suitable header is available.

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 API endpoint called. Returns undef if no suitable header is available.


AUTHOR

Marc Mims <marc@questright.com>


COPYRIGHT & LICENSE

Copyright (c) 2016 Marc Mims

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026