line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Twitter::Role::API::UploadMedia; |
2
|
|
|
|
|
|
|
$Net::Twitter::Role::API::UploadMedia::VERSION = '4.01010'; |
3
|
5
|
|
|
5
|
|
3021
|
use Moose::Role; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
32
|
|
4
|
5
|
|
|
5
|
|
16933
|
use Net::Twitter::API; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
28
|
|
5
|
5
|
|
|
5
|
|
2764
|
use DateTime::Format::Strptime; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
203
|
|
6
|
5
|
|
|
5
|
|
21
|
use URI; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
697
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has upload_url => isa => 'Str', is => 'ro', default => 'http://upload.twitter.com/1.1'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
after BUILD => sub { |
11
|
|
|
|
|
|
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$self->{upload_url} =~ s/^http:/https:/ if $self->ssl; |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
base_url 'upload_url'; |
17
|
|
|
|
|
|
|
authenticate 1; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
twitter_api_method upload => ( |
20
|
|
|
|
|
|
|
path => 'media/upload', |
21
|
|
|
|
|
|
|
method => 'POST', |
22
|
|
|
|
|
|
|
params => [qw/media/], |
23
|
|
|
|
|
|
|
required => [qw/media/], |
24
|
|
|
|
|
|
|
booleans => [qw/possibly_sensitive display_coordinates/], |
25
|
|
|
|
|
|
|
returns => 'Image', |
26
|
|
|
|
|
|
|
description => 'Upload images to twitter without posting them on the timeline' |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Net::Twitter::Role::API::UploadImage - A definition of the Twitter Upload API as a Moose role |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 4.01010 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
package My::Twitter; |
44
|
|
|
|
|
|
|
use Moose; |
45
|
|
|
|
|
|
|
with 'Net::Twitter::API::UploadImage'; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 DESCRIPTION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This module provides definitions the Twitter Upload API methods. |