twitteroauth(https://github.com/abraham/twitteroauth)获取后返回空数组。 Hostinger主持

时间:2015-02-18 14:55:29

标签: twitter get hosting twitter-oauth

我一直在编写一些PHP来使用twitteroauth(https://github.com/abraham/twitteroauth)从twitter API获取一些twits。我一直在使用我的本地apache服务器并运行代码没有任何问题。

之后,我将代码上传到hostinger(PHP版本5.4),但是当代码执行时,它在GET中返回一个空数组。

代码:

//Create the connection
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);

//Verify credentials
$content = $twitter->get('account/verify_credentials');

使用我的本地服务器$ content有正确的响应(代码200,正确验证)。在hostinger(http://www.hostinger.es)中,$ content是一个空数组。

你对此有所了解吗?

非常感谢。

1 个答案:

答案 0 :(得分:1)

我有完全相同的问题,谷歌把我带到这里,也许主持人在Twitter上被禁止。可能是他们的时间是3分钟。

date_default_timezone_set("UTC");
echo date("Y-m-d H:i:s", time());