I used 这个推特库 https://github.com/abraham/twitteroauth并收到此错误。谁能告诉我哪里出错了?
ERROR
Fatal error: Class 'Abraham\TwitterOAuth\Config' not found in D:\wamp\www\Abraham\TwitterOAuth\TwitterOAuth.php on line 17
PHP
<?php
require_once("Abraham/TwitterOAuth/TwitterOAuth.php"); //Path to twitteroauth library you downloaded in step 3
//keys and tokens initialised
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret) {
$connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$tweets = $connection->get("https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=".$twitteruser."&count=".$notweets);
echo json_encode($tweets);
echo $tweets; //testing remove for production
?>
您确定这是正确的方法吗? :
require_once("Abraham/TwitterOAuth/TwitterOAuth.php");
你可以尝试:
require_once("Abraham/autoload.php");
require_once("Abraham/TwitterOAuth/TwitterOAuth.php");
use Abraham\TwitterOAuth\TwitterOAuth;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)