0
我正在嘗試做一個簡單的Twitter發佈腳本並獲得一些奇怪的結果。這是相關代碼:奇怪的Twitter授權錯誤
if ($access_token eq "" || $access_token_secret eq "") {
$nt = Net::Twitter->new(
traits => [qw/API::RESTv1_1 OAuth/],
consumer_key => $app_key,
consumer_secret => $app_secret,
ssl => 1,
);
} else {
$nt = Net::Twitter->new(
traits => [qw/API::RESTv1_1 OAuth/],
consumer_key => $app_key,
consumer_secret => $app_secret,
access_token => $access_token,
access_token_secret => $access_token_secret,
ssl => 1,
);
}
if (!$nt->authorized) {
print "You must authorize this app at ", $nt->get_authorization_url, " and enter the PIN below.\n\nPIN: ";
}
與以下錯誤的NT-$> get_authorization_url行的代碼失敗:
Net::Twitter::Role::Oauth::get_authorization_url(): GET https://api.twitter.com/oauth/request_token failed: 401 Unauthorized
這是沒有意義的我,爲什麼它要求被授權爲了獲得授權URL ...
你檢查了你的時間戳嗎? – Leistungsabfall 2014-09-28 14:51:09
我的時間戳? – Dendory 2014-09-28 15:14:22