트위터 api 는 3종류의 api 가 있다. (참조 : https://dev.twitter.com/start )

  • Search API
  • REST API
  • Streaming API

 

oAuth 인증을 위해서는 다음 값이 필요하다.

  • Consumer Key
  • Consumer Secret
  • Access Token
  • Access Token Secret

oAuth 에 관한 자세한 정보는 http://dev.naver.com/openapi/apis/oauth/guide 를 참조한다.

 

1. 트위터 계정 설정하기

access token 을 발급받기 위해서 https://dev.twitter.com/apps 로 들어가 트위터 어플리케이션을 생성한다.

어플리케이션을 생성하면, oAuth 인증 Access Level 이 Read-only 로 되어있다. 트윗을 날리기 위해선, Write Level 이 필요하다. 

settings 메뉴에 들어가서 Application Type 을 'Read and Write' 로 변경한다.

npm install oauth 

 

 

더 많은 예제들은 node-twitter-examples를 참고해주세요.

+ Recent posts