php로 트위터 API를 이용해 트윗 쓰기

sadrove의 이미지

미리 저장된 oauth_token과 oauth_token_secret 키를 갖고, 트위터에 글을 쓰려고 합니다.
코드는 대략 아래와 같습니다.

$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $get_oauth_token, $get_oauth_token_secret); 
 
$content = $connection->get('account/verify_credentials'); 
echo $content->screen_name;    // 트위터 아이디 노출 테스트
 
$connection->post('statuses/update', array('status' => 'test'));    // 트위터로 test라고 트윗 쓰기

echo $content->screen_name; 부분에서 올바르게 트위터 아이디를 출력해 주는데요.

이상하게 트위터로 글쓰기는 되지 않습니다.ㅠ.ㅠ..

무엇이 문제인걸까요?

이용한 라이브러리는 https://github.com/abraham/twitteroauth/downloads 입니다.

도움 부탁드립니다.

감사합니다.

neocoin의 이미지

반환되는 코드에 문제가 기술되어 있을 겁니다. 그거 먼저 확인하세요.

http state 코드로 주기도 합니다.