[英]Twitter API 1.1 get direct messages “Your credentials do not allow access to this resource” error code 220
<?php
require_once('twitteroauth/twitteroauth.php');
require_once('config.php');
require_once('function.php');
header("Content-Type: text/html; charset=utf-8");
// Datadan kullanıcı çekiliyor
$a = mysql_query("select * from users WHERE twid = 326960131");
$i=0;
while ($b = mysql_fetch_array($a)) {
$oauth_token[$i] = $b["oauth_token"];
$oauth_secret[$i] = $b["oauth_secret"];
$tid[$i]=$b["twid"];
$connection[$i] = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token[$i], $oauth_secret[$i]);
//Tüm bilgilerin kaynağı alınıyor
$bilgi[$i] = $connection[$i]->get('account/verify_credentials');
$i++;
}
// -------------------------
// Tweetpost döngüsü
for ($i=0;$i<count($tid);$i++) {
$screen_name = $bilgi[$i]->screen_name;
$profilresmi = $bilgi[$i]->profile_image_url;
$kullaniciid = $bilgi[$i]->id;
$takipcisayisi = $bilgi[$i]->followers_count;
$tweet = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access, $secret);
$followers = $tweet->get('direct_messages', array('count' => '1'));
print_r($followers);
}
flush();
?>
When I try to run this codes It says 当我尝试运行此代码时,它说
> stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Your credentials do not allow access to this resource [code] => 220 ) ) )
I want to get direct messages of selected user. 我想获得所选用户的直接消息。 But it says like that. 但是它是那样说的。 Can you help me? 你能帮助我吗?
There are two possible problems. 有两个可能的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.