【发布时间】:2012-08-01 01:21:45
【问题描述】:
我正在尝试使用 dev.twitter.com 上的应用页面上显示的 oauth_token 和 oauth_token_secret 搜索用户,但我得到了
“无法验证您的身份。”
我使用正确值访问的网址:
https://api.twitter.com/1/users/search.json?q=foo&oauth_token=123&oauth_token_secret=abc
【问题讨论】:
标签: twitter
我正在尝试使用 dev.twitter.com 上的应用页面上显示的 oauth_token 和 oauth_token_secret 搜索用户,但我得到了
“无法验证您的身份。”
我使用正确值访问的网址:
https://api.twitter.com/1/users/search.json?q=foo&oauth_token=123&oauth_token_secret=abc
【问题讨论】:
标签: twitter
这里你正在做一个经过身份验证的请求,这是错误的身份验证方式。
要做你想做的事,你可以做这样的事情(这里计算有多少人在搜索中使用你的应用程序):
unsigned int nbTweets = 0;
Timeline tl = twitter.search("foo"); // http://search.twitter.com/search.json?q=foo
foreach (Tweet t in tl) {
// Retrieving the application used to write the tweet in the "source" field of the tweet
String tweetHTMLSource = t.source; // tweetHTMLSource == '<a href="clientName.callbackURL" rel="nofollow">clientName</a>'
String clientName = tweetHTMLSource.plainText; // clientName == "clientName"
if (clientName == "MYAPPLICATION_NAME") {
nbTweets++;
}
}
【讨论】: