Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using OAuth for tweets #2

Open
nomadeous opened this issue May 16, 2011 · 1 comment
Open

Problem using OAuth for tweets #2

nomadeous opened this issue May 16, 2011 · 1 comment

Comments

@nomadeous
Copy link

Hi,

I've started using erlang_twitter client to tweet but unsuccessfully.
I'm trying to tweet using access that I've provided from my account to my application.
I use the following code to get tokens and post a tweet :

Consumer = {"My Real Consumer Key", "My Real Consumer Key", hmac_sha1}.
RequestTokenURL = "http://api.twitter.com/oauth/request_token".
{ok, ResponseR} = oauth:get(RequestTokenURL, [], Consumer, "", "").
ParamsR = oauth_http:response_params(ResponseR).
TokenR = oauth:token(ParamsR).
TokenSecretR = oauth:token_secret(ParamsR).

%% Everything is OK till here. So make a new tweet :
twitter_client:direct_new({Consumer, TokenR, TokenSecretR}, Msg).

=> this function returns "ok", but that's false. While debugging, I have the following error from twitter :

\n\n /direct_messages/new.xml\n Could not authenticate you.\n

Am I missing something ?

I get the same error when using auth API directly :
oauth:post("http://api.twitter.com/direct_messages/new.xml",["My New Tweet"], Consumer, TokenR, TokenSecretR).

@ngerakines
Copy link
Owner

The oauth functionality was contributed. I'll have to dig back to find the orig author to ask about this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants