itter::VERSION = '4.01043';
use Moose;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use JSON::MaybeXS;
use Net::Twitter::Core;
use Digest::SHA qw/sha1_hex/;
use Class::Load ();
use namespac
ref $t[0] eq 'HASH' ) {
my $params = shift @t;
my $sig = sha1_hex(JSON->new->utf8->encode($params));
my $sn = $serial_for_params{$sig} ||= ++$serial_nu
required => [qw/media_id/],
returns => 'HashRef',
content_type => 'application/json',
description => <<'EOT',
Adds metadata -- alt text, in particular -- to a previously uploade
Twitter API
use 5.008001;
use Moose;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use JSON::MaybeXS;
use URI::Escape;
use HTTP::Request::Common;
use Net::Twitter::Error;
use Scalar::Util q
role composition from bitching ??
has _json_handler => (
is => 'rw',
default => sub { JSON->new->allow_nonref->utf8 },
handles => { from_json => 'decode' },
);
sub _legacy_synthet
l.git/commit/eaf7a4d2
return { map { utf8::upgrade($_) unless ref($_); $_ } %$args };
}
sub _json_request {
my ($self, $http_method, $uri, $args, $authenticate, $dt_parser, $content_type ) =
:Twitter::WrappedResult;
$Net::Twitter::WrappedResult::VERSION = '4.01043';
use Moose;
# decoded JSON Twitter API response
has result => (
is => 'ro',
required => 1,
);
has http_respon
_limit_remaining;
=head1 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 da
Twitter result and HTTP response.
=item result
Returns the Twitter API result, i.e., the decode JSON response body.
=item http_response
Returns the L<HTTP::Response> object for the API call.
=ite
an empty string
=item twitter_error_code
Returns the first numeric twitter error code from the JSON response body, if
there is one. Otherwise, it returns 0 so the result should always be safe use
i
>rate_limit_remaining;
=head1 DESCRIPTION
Normally, Net::Twitter API methods return the decoded JSON body from the HTTP response. Some useful information, notably rate limit information, is included
turn a L<Net::Twitter::WrappedResult> object that includes both the HTTP response and the decoded JSON response body. See L<Net::Twitter::WrappedResult> for details.
=head1 AUTHOR
Marc Mims <marc@qu
rser,
{
error => "TWITTER RETURNED ERROR MESSAGE BUT PARSING OF JSON RESPONSE FAILED - "
. $res->message
}
)
ursors::VERSION = '4.01043';
use Moose::Role;
use namespace::autoclean;
requires qw/_json_request/;
around _json_request => sub {
my $orig = shift;
my $self = shift;
my ($http_method, $u
Request::Common qw/POST/;
use Net::Twitter::Types;
requires qw/_add_authorization_header ua from_json/;
use namespace::autoclean;
# flatten oauth_urls with defaults
around BUILDARGS => sub {
my
${ \$res->code }: ${ \$res->message }"
unless $res->is_success;
my $r = $self->from_json($res->decoded_content);
croak "unexpected token type: $$r{token_type}" unless $$r{token_type}
e_parser => $datetime_parser,
base_url_method => $_base_url,
path_suffix => '.json',
@_,
);
my $deprecation_coderef = ref $options{deprecated} eq ref sub {}
->${ \$options{base_url_method} } . "/$local_path$options{path_suffix}");
return $self->_json_request(
$options{method},
$uri,
$args,
$authenti
path (for
legacy reasons). If you want to suffix appended, pass the empty
string. Defaults to ".json".
=item method
A string containing the HTTP method for the call. Defaults to "GET".
=item add