Line | |
---|
1 | #!/usr/bin/env perl |
---|
2 | use strict; |
---|
3 | use warnings; |
---|
4 | use utf8; |
---|
5 | use Net::Twitter; |
---|
6 | |
---|
7 | use YAML::Tiny; |
---|
8 | my $config = (YAML::Tiny->read('config.yml'))->[0]; |
---|
9 | |
---|
10 | my $consumer_key = $config->{'consumer_key'}; |
---|
11 | my $consumer_key_secret = $config->{'consumer_secret'}; |
---|
12 | my $access_token = $config->{'access_token'}; |
---|
13 | my $access_token_secret = $config->{'access_token_secret'}; |
---|
14 | |
---|
15 | my $nt = Net::Twitter->new( |
---|
16 | traits => ['API::REST', 'OAuth'], |
---|
17 | consumer_key => $consumer_key, |
---|
18 | consumer_secret => $consumer_key_secret, |
---|
19 | ); |
---|
20 | $nt->access_token($access_token); |
---|
21 | $nt->access_token_secret($access_token_secret); |
---|
22 | |
---|
23 | my $res = $nt->update({ status => "Perl から Twiitter を更新するテストですよー" }); |
---|
Note: See
TracBrowser
for help on using the repository browser.