2014-09-28 5 views
0

나는 간단한 트위터 게시 스크립트를 수행하고 이상한 결과를 얻으려고합니다. , 왜 승인을 요청할 않습니다이 나에게 아무 의미이상한 트위터 인증 오류

Net::Twitter::Role::Oauth::get_authorization_url(): GET https://api.twitter.com/oauth/request_token failed: 401 Unauthorized 

: 코드는 다음과 같은 오류와 함께 $ NT-> get_authorization_url 줄에 실패

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: "; 
} 

: 이것은 관련 코드 승인 URL을 얻으려면 ...

+1

타임 스탬프를 확인 했습니까? – Leistungsabfall

+0

내 타임 스탬프? – Dendory

답변

1

Doh가 원인을 발견했습니다. 이는 내 VM의 시계가 너무 늦게 설정되어있는 경우 발생합니다. Leistungsabfall의 타임 스탬프에 대해 언급 해 주신 것에 대해 감사 드리며, 트위터 오류 메시지가 더 바람직하다고 생각합니다.