0
내 웹 페이지에 Twitter 사용자 시간대를 통합하고 싶습니다. 그 다음 lib 디렉토리를 사용하고 있습니다. TwitterAPIExchange.php (https://github.com/J7mbo/twitter-api-php)Twitter Api 1.1 응답을 { "오류": [{ "메시지": "인증 할 수 없습니다", "코드": 32}]}
index.php 파일에 필요한 모든 키를 올바르게 제공했습니다.
나는 Index.php를 실행하려고 할 때마다 { "오류"를받습니다 : [{ "메시지": "당신을 인증 할 수 없습니다", "코드": 32}]} 오류와 나는 알아낼 수 없습니다 그것을 해결하는 방법.
get 메소드를 사용하여 데이터를 가져옵니다. 내가 코드에서 뭔가 잘못을보고 있지 않다
ini_set('display_errors', 1);
require_once('TwitterAPIExchange.php');
/** Set access tokens here - see: https://dev.twitter.com/apps/ **/
$settings = array(
'oauth_access_token' => "xxxxxxxxxxxxxx",
'oauth_access_token_secret' => "xxxxxxxxxxxxxxxxxxxx",
'consumer_key' => "xxxxxxxxxxxxxx",
'consumer_secret' => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
);
/** Perform a GET request and echo the response **/
/** Note: Set the GET field BEFORE calling buildOauth(); **/
$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
$getfield = '?screen_name=fresherworld';
$requestMethod = 'GET';
$twitter = new TwitterAPIExchange($settings);
echo $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();