<?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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.