2012-04-18 8 views
0

twitcurlを使用してLinuxおよびTwitterで現在C++を使用しています。私はtwitcurlをビルドしました。一般的に動作するようですが、プロジェクトのtwitterClientサンプルを少しカスタマイズしたバージョンからツイートできました。しかし、私はユーザーのタイムラインを読むのに苦労してきました。twitcurl timelineUserGetメソッドからNot Authorizedエラーが発生しました

今、正しいユーザーとして最初にツイートするようになっているので、一般的な認証が機能していることが分かりました。

しかし、私は以下のコード使用してユーザーのタイムラインを読み込むしようとすると:

twitterClient:: twitCurl::timelineUserGet web response: 
<?xml version="1.0" encoding="UTF-8"?><hash><request>/1/statuses/user_timeline.xml?  count=5?trim_user=1</request><error>Not authorized</error></hash> 

私は、これは無効なURLに関連しているかどうかわからないよ:私は次のエラーを取得する

/* Get user timeline */ 
replyMsg = ""; 
printf("\nGetting user timeline\n"); 
if(twitterObj.timelineUserGet(true, false, 5)) 
{ 
    twitterObj.getLastWebResponse(replyMsg); 
    printf("\ntwitterClient:: twitCurl::timelineUserGet web response:\n%s\n", replyMsg.c_str()); 
} 
else 
{ 
    twitterObj.getLastCurlError(replyMsg); 
    printf("\ntwitterClient:: twitCurl::timelineUserGet error:\n%s\n", replyMsg.c_str()); 
} 

をtwitcurlは複数で生成されますか?認証と競合する可能性のあるシンボル

完全なソースコードはhttps://github.com/paulspencerwilliams/CPlusPlusSocialPlayground/blob/master/twitterClient.cppにあります。

答えて

1

The following post helped me to solve the same problem

What steps will reproduce the problem?

Sending certain characters to twitter API (Any character that has to be percent encoding, except the blank space?).

What is the expected output? What do you see instead?

I'd expect twitter's server to accept my oauth signature but it hits me in the face instead.

What version of the product are you using? On what operating system?

r88, this problem applies to both linux and wii (through devkitpro)

Please provide any additional information below.

The problem can be fixed by removing the urlencode() calls within buildOAuthRawDataKeyValPairs() in oauth.cpp.

That is according to how twitter says we have to do it . I don't know (did not check) if that's how the oauth spec says it should be done but it is clearly how it works with twitter.

Did you write oauthlib.cpp?

+2

あなたは、リンク内のコンテンツの一部を投稿する必要があります。リンクが失敗した場合、これは他のユーザーには役立ちません。 – Taryn

+0

@bluefeet彼は実際にした、彼のポストの内容は、リンクの実際のソリューションです。 – ForceMagic

+1

@ForceMagic私の主張は、リンクの内容全体がここに投稿されなければならないということです。リンクが失敗した場合は、参照することはありません。 – Taryn