当使用 Twitter 提供的所有四个密钥(消费者密钥、消费者密钥、访问密钥和访问密钥密钥(时,我能够在我的网站上成功显示我应用的最新推文。然而,我正在使用的TwitterOath代码(由Abraham Williams https://github.com/abraham/twitteroauth(似乎拆分了两种不同类型的身份验证:
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
$this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
$this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
$this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
} else {
$this->token = NULL;
}
}
据我了解,您可以简单地不指定访问密钥和访问密钥秘密,并且仍然让消费者工作(因为访问内容允许您以用户身份执行操作(。
基本上,我想在不指定访问密钥和访问密钥秘密的情况下显示推文(因为我的客户不想向我提供这些凭据!问题是,当我不指定它们时,我会收到"错误的身份验证数据 215"错误。
这是否意味着如果不提供所有四个键,就无法使用status/user_timeline.json进行显示?
希望这足够清楚!
谢谢
来自 Twitter API v1.1 文档,
search queries will need to be authenticated in version 1.1
这是必需的,以便他们可以限制费率。Twitter API v1 已于 2013 年 6 月 11 日停用。您现在只能使用 v1.1