projects
/
lab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* rotate page 04 to the right direction
[lab.git]
/
twitter
/
get_oauth.pl
diff --git
a/twitter/get_oauth.pl
b/twitter/get_oauth.pl
index
6f840ab
..
ec96c19
100755
(executable)
--- a/
twitter/get_oauth.pl
+++ b/
twitter/get_oauth.pl
@@
-2,12
+2,17
@@
use strict;
use warnings;
use utf8;
use strict;
use warnings;
use utf8;
-use Net::Twitter;
+use Net::Twitter::Lite;
-my $consumer_key = 'CONSUMER_KEY';
-my $consumer_key_secret = 'CONSUMER_KEY_SECRET';
+use YAML::Tiny;
+my $config = (YAML::Tiny->read('config.yml'))->[0];
-my $nt = Net::Twitter->new(
+my $consumer_key = $config->{'consumer_key'};
+my $consumer_key_secret = $config->{'consumer_secret'};
+my $access_token = $config->{'access_token'};
+my $access_token_secret = $config->{'access_token_secret'};
+
+my $nt = Net::Twitter::Lite->new(
traits => ['API::REST', 'OAuth'],
consumer_key => $consumer_key,
consumer_secret => $consumer_key_secret,
traits => ['API::REST', 'OAuth'],
consumer_key => $consumer_key,
consumer_secret => $consumer_key_secret,