0
即使下面最基本的代码也不会返回任何东西,从GitHub运行最新版本的tmhOAuth和tmhUtilities,运行它(使用从Twitter中的My应用程序复制的有效密钥和秘密开发站点 - 这里为了安全目的而隐藏)。tmhOAuth不会返回任何东西,所以很困惑
该页面根本不输出任何内容,没有任何内容......如此困惑?这个脚本是否与CSF/cPanel有任何防火墙问题?我已经尝试从服务器作为root ping api.twitter.com,并且工作正常。
真的在为创意挣扎吗?因为之前有效,那么下一分钟根本就没有任何反应。
的$码A的var_dump返回NULL:/
<?php
require 'tmhOAuth.php';
require 'tmhUtilities.php';
$tmhOAuth = new tmhOAuth(array(
'consumer_key' => '********',
'consumer_secret' => '****************',
'user_token' => '********',
'user_secret' => '****************'
));
$code = $tmhOAuth->request('GET', $tmhOAuth->url('1/account/verify_credentials'));
if ($code == 200) {
echo 'The access level of this token is: ' . $tmhOAuth->response['headers']['x_access_level'] . PHP_EOL;
tmhUtilities::pr($tmhOAuth->response);
} else {
tmhUtilities::pr(htmlentities($tmhOAuth->response['response']));
}
$ tmhOAuth回报的的var_dump(键隐藏,但有效):
object(tmhOAuth)#1 (3) { ["params"]=> array(0) { } ["auto_fixed_time"]=> bool(false) ["config"]=> array(19) { ["consumer_key"]=> string(22) "**********" ["consumer_secret"]=> string(42) "*********" ["user_token"]=> string(50) "********" ["user_secret"]=> string(43) "************" ["use_ssl"]=> bool(true) ["host"]=> string(15) "api.twitter.com" ["debug"]=> bool(true) ["force_nonce"]=> bool(false) ["nonce"]=> bool(false) ["force_timestamp"]=> bool(false) ["timestamp"]=> bool(false) ["oauth_version"]=> string(3) "1.0" ["curl_connecttimeout"]=> int(30) ["curl_timeout"]=> int(10) ["curl_ssl_verifypeer"]=> bool(false) ["curl_followlocation"]=> bool(false) ["is_streaming"]=> bool(false) ["streaming_eol"]=> string(2) " " ["streaming_metrics_interval"]=> int(60) } }