Social

Twitter :: 읽어오기

Twitter 에서 데이터를 가져오는 방법에 대해 설명하고, 1~2개 정도의 실제 예제를 확인합니다.

class TwitterOAuth (cont'd)

  • mixed get($url, $parameters = array())

 

API

  • GET account/verify_credentials
  • GET statuses/home_timeline

 

Paging

  • count
  • since_id
  • max_id
  • page

 

Code snippet

  • simple query
// Access token 을 포함한 TwitterOAuth object 생성
$connection = new TwitterOAuth($consumer_key, $consumer_secret, $token, $token_secret);

// get user profile
$user = $connection->get('account/verify_credentials');

// get home timeline
$timeline = $connection->get('statuses/home_timeline');

// parameter
$params = array('count'=>10);
$timeline2 = $connection->get('statuses/home_timeline', $params);

 

External Links

댓글

댓글 본문
  1. jsroad
    감사합니다.
  2. 감사합니다.
    버전이 바뀌었지만 그래도 참고 많이 되었습니다. 감사합니다 .: ^)
  3. 쌈닭
    :)
버전 관리
egoing
현재 버전
선택 버전
graphittie 자세히 보기