0

dev.twitter.com のアプリ ページに示されているように、oauth_token と oauth_token_secret を使用してユーザーを検索しようとしていますが、

「認証できませんでした。」

正しい値でヒットしているURL:

https://api.twitter.com/1/users/search.json?q=foo&oauth_token=123&oauth_token_secret=abc

4

1 に答える 1

0

ここでは、認証されたリクエストを行っていますが、それを認証する方法が間違っています。

やりたいことを行うには、次のようにすることができます (ここでは、検索でアプリを使用する人の数を数えています)。

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++;
    }
}
于 2012-07-31T17:21:45.470 に答える