source: lab.git/twitter/get_oauth.pl @ 8ac2029

vendor
Last change on this file since 8ac2029 was d200f4d, checked in by mitty <mitty@…>, 14 years ago

git-svn-id: https://lab.mitty.jp/svn/lab/vendor@44 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

  • Property mode set to 100755
File size: 756 bytes
RevLine 
[d200f4d]1#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Net::Twitter;
6
7my $consumer_key = 'CONSUMER_KEY';
8my $consumer_key_secret = 'CONSUMER_KEY_SECRET';
9
10my $nt = Net::Twitter->new(
11  traits          => ['API::REST', 'OAuth'],
12  consumer_key    => $consumer_key,
13  consumer_secret => $consumer_key_secret,
14);
15print 'access this url by bot account : '.$nt->get_authorization_url."\n";
16print 'input verifier PIN : ';
17my $verifier = <STDIN>;
18chomp $verifier;
19
20my $token = $nt->request_token;
21my $token_secret = $nt->request_token_secret;
22
23$nt->request_token($token);
24$nt->request_token_secret($token_secret);
25
26my($at, $ats) = $nt->request_access_token(verifier => $verifier);
27
28print "Access token : ".$at."\n";
29print "Access token secret : ".$ats."\n";
Note: See TracBrowser for help on using the repository browser.