Skip to content

Instantly share code, notes, and snippets.

@tsux89
Last active December 17, 2015 06:58
Show Gist options
  • Save tsux89/5568963 to your computer and use it in GitHub Desktop.
Save tsux89/5568963 to your computer and use it in GitHub Desktop.
Twitter for iPhoneのAccessTokenとAccessTokenSecretを取得するスクリプト。
#!/usr/bin/perl
use strict;
use Net::Twitter;
my $nt = Net::Twitter->new(
traits => ['API::REST', 'OAuth'],
consumer_key => "IQKbtAYlXLripLGPWd0HUA",
consumer_secret => "GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU",
);
print "Login URL: ", $nt->get_authorization_url, "\n";
urlAutoLink($nt->get_authorization_url);
print "Enter the PIN: ";
my $pin = <STDIN>;
chomp $pin;
my($access_token, $access_token_secret, $user_id, $screen_name) = $nt->request_access_token(verifier => $pin);
print "$access_token\n";
print "$access_token_secret\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment