line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Twitter::Role::API::UploadMedia; |
2
|
|
|
|
|
|
|
$Net::Twitter::Role::API::UploadMedia::VERSION = '4.01042'; |
3
|
7
|
|
|
7
|
|
5264
|
use Moose::Role; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
51
|
|
4
|
7
|
|
|
7
|
|
25773
|
use Net::Twitter::API; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
44
|
|
5
|
7
|
|
|
7
|
|
3826
|
use DateTime::Format::Strptime; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
53
|
|
6
|
7
|
|
|
7
|
|
419
|
use URI; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
1233
|
|
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
|
|
|
|
|
|
|
twitter_api_method upload_status => ( |
30
|
|
|
|
|
|
|
path => 'media/upload', |
31
|
|
|
|
|
|
|
method => 'GET', |
32
|
|
|
|
|
|
|
params => [qw/media_id command/], |
33
|
|
|
|
|
|
|
required => [qw/media_id command/], |
34
|
|
|
|
|
|
|
booleans => [qw//], |
35
|
|
|
|
|
|
|
returns => 'status', |
36
|
|
|
|
|
|
|
description => 'Check the status for async video uploads.' |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Net::Twitter::Role::API::UploadImage - A definition of the Twitter Upload API as a Moose role |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 4.01042 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
package My::Twitter; |
54
|
|
|
|
|
|
|
use Moose; |
55
|
|
|
|
|
|
|
with 'Net::Twitter::API::UploadImage'; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This module provides definitions the Twitter Upload API methods. |
60
|
|
|
|
|
|
|
|