我正在尝试编写一个Twitter程序来获取我的时间表。我正在使用亚伯拉罕威廉姆斯认证码
出现的错误 注意:未定义的属性: 第12行的G:\ xampp \ htdocs \ fake.php中的stdClass :: $ screen_name 连接为@ Notice:尝试获取非对象的属性 第20行的G:\ xampp \ htdocs \ fake.php鸣叫:
码
<?php
// Read in our saved access token/secret
$accessToken =file_get_contents("twitteroauth/access_token.txt");
$accessTokenSecret = file_get_contents("twitteroauth/access_token_secret.txt");
// Create our twitter API object
require_once("twitteroauth/twitteroauth.php");
$oauth = new TwitterOAuth('mykey', 'secret key', $accessToken, $accessTokenSecret);
// Send an API request to verify credentials
$credentials = $oauth->get("account/verify_credentials");
echo "Connected as @" . $credentials->screen_name;
// Post our new "hello world" status
$home_timeline = $oauth->get('statuses/home_timeline',array('count' => 40));
// how do i get the information out of home_timeline
foreach ($home_timeline as $status) {
echo "Tweet: $status->text<br />\n";
}
?>