Skip to content

Instantly share code, notes, and snippets.

@sugyan
Created October 13, 2009 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugyan/209368 to your computer and use it in GitHub Desktop.
Save sugyan/209368 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Encode 'decode_utf8';
use Net::Twitter::Lite;
my $nt = Net::Twitter::Lite->new(
consumer_key => 'http://twitter.com/oauth_clients で登録したもの',
consumer_secret => 'http://twitter.com/oauth_clients で登録したもの',
);
# The client is not yet authorized: Do it now
print "Authorize this app at ", $nt->get_authorization_url, "\n";
print "and enter the PIN# :";
my $pin = <STDIN>; # wait for input
chomp $pin;
my($access_token, $access_token_secret) = $nt->request_access_token(verifier => $pin);
print "access_token: $access_token\n";
print "access_token_secret: $access_token_secret\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment