[twitter-dev] Re: Problem with status encoding... I guess

2010-05-17 Thread @sebagomez
I'm migrating my own twitter client (http://sgomez.blogspot.com/
2010/01/yatc-yet-another-tweeter-client.html) to xAuth and building my
own lib :S thus the issues...

On May 16, 12:11 pm, Konpaku Kogasa kogasa.l...@gmail.com wrote:
 Hello,

  Hello Konpaku, thanks for you answer.
  I am encoding my text with UTF8, I don´t know what you mean by your
  files

 Sorry I meant all the source files.  Also what language and oAuth
 library are you using for this?

 - Konpaku Kogasa


[twitter-dev] Re: Problem with status encoding... I guess

2010-05-17 Thread @sebagomez
I found the solution, my encoding function was not encoding according
to RFC3986 as twitter expects.
I had to create a function myself and I bloged about it... everything
is working now! :)

http://sgomez.blogspot.com/2010/05/encoding-strings-for-twitter-api.html

Hope it helps someone else

On May 17, 9:57 am, @sebagomez sebastiangomezcor...@gmail.com
wrote:
 I'm migrating my own twitter client (http://sgomez.blogspot.com/
 2010/01/yatc-yet-another-tweeter-client.html) to xAuth and building my
 own lib :S thus the issues...

 On May 16, 12:11 pm, Konpaku Kogasa kogasa.l...@gmail.com wrote:



  Hello,

   Hello Konpaku, thanks for you answer.
   I am encoding my text with UTF8, I don´t know what you mean by your
   files

  Sorry I meant all the source files.  Also what language and oAuth
  library are you using for this?

  - Konpaku Kogasa


[twitter-dev] Re: Problem with status encoding... I guess

2010-05-16 Thread @sebagomez
Hello Konpaku, thanks for you answer.
I am encoding my text with UTF8, I don´t know what you mean by your
files

Also, I don´t know if BOM is necesarry cause as I mentioned before, it
works with other international characters, but I will give that a try
though

thanks

On May 15, 8:48 pm, Konpaku Kogasa kogasa.l...@gmail.com wrote:
 Hello,

  I had a few bugs with encoding, I was not using UTF8 and now I do, so
  I am able to tweet stauff like Peñarol á é í ó ú (spanish lang
  characters). I was making some tests and I noticed that if I want to
  set '!' as my status (just the exclamation mark) it dos not work... I
  get an Incorrect signature error message.

 I had this issue before.  Check the encoding of your files.  It needs
 to be set to UTF-8 (can't remember if it's with or without BOM
 though..)

 - Konpaku Kogasa


[twitter-dev] Re: Problem with status encoding... I guess

2010-05-15 Thread @sebagomez
Great, thanks Adam!
As I said before, many OAuth libs do not support international
characters :(

On May 15, 1:05 am, Adam Ransom v0id@gmail.com wrote:
 I'm working on a Japanese twitter app and have had similar challenges with
 encoding (i.e. the OAuth lib I used didnt support Japanese). I'll have a bit
 of a look and see if I have the same ! problem as you and let you know.

 Adam

 On Sat, May 15, 2010 at 7:22 AM, @sebagomez
 sebastiangomezcor...@gmail.comwrote:



  I have an app using OAuth (actaully xAuth) and it is working well...
  or almost well.

  I had a few bugs with encoding, I was not using UTF8 and now I do, so
  I am able to tweet stauff like Peñarol á é í ó ú (spanish lang
  characters). I was making some tests and I noticed that if I want to
  set '!' as my status (just the exclamation mark) it dos not work... I
  get an Incorrect signature error message.

  I tried moving stuff around but my actual config works in most cases.
  I can even twit 'é' as my status and it works!
  :S

  Can anybody point me in the right direction... most samples I've seen
  online don't care about UTF8 encoding, probably because most of them
  are built in the US :(

  Thanks.
  Regards,
  Seba


[twitter-dev] Re: Getting 401 when using one access token with OAuth

2010-05-15 Thread @sebagomez
Take a look in this post at the suggestion Taylor sent me.

http://groups.google.com/group/twitter-development-talk/browse_thread/thread/c04e4f73929a15c3/d9b6ab0c427493eb#d9b6ab0c427493eb

regards

On May 14, 5:48 pm, bjhess ba...@bjhess.com wrote:
 I'm trying to implement the following in Ruby:

 http://dev.twitter.com/pages/oauth_single_token

 Unfortunately I'm receiving 401's from to Twitter usernames, harvest
 and harvest_test. Both have been set up with an OAuth key and secret.

 I'm essentially using the identical code to your sample. I contacted
 Twitter support seeking xAuth access, thinking that was what was
 leading me to the 401. They've sent me here.

 Anything you'd like me to share from how I'm calling Twitter would be
 beneficial. Hopefully you can see my failures in your logs from
 yesterday, though.

 Thanks!

 ~Barry Hesshttp://www.getharvest.com


[twitter-dev] Problem with status encoding... I guess

2010-05-14 Thread @sebagomez
I have an app using OAuth (actaully xAuth) and it is working well...
or almost well.

I had a few bugs with encoding, I was not using UTF8 and now I do, so
I am able to tweet stauff like Peñarol á é í ó ú (spanish lang
characters). I was making some tests and I noticed that if I want to
set '!' as my status (just the exclamation mark) it dos not work... I
get an Incorrect signature error message.

I tried moving stuff around but my actual config works in most cases.
I can even twit 'é' as my status and it works!
:S

Can anybody point me in the right direction... most samples I've seen
online don't care about UTF8 encoding, probably because most of them
are built in the US :(

Thanks.
Regards,
Seba


[twitter-dev] I can't get update status using xAuth to work :(

2010-05-12 Thread @sebagomez
I have the access_token with no problem, so now I have my oauth_token
and my oauth_token_secret, but every time I want to update my status I
get a 401... what am I doing wrong?

Here's my signature base string:
POSThttp%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.xml
oauth_consumer_key%3DCONSUMER_KEY%26oauth_nonce%3Df897b67a-fb03-42fe-
aa97-aec348f32f9c%26oauth_signature_method%3DHMAC-
SHA1%26oauth_timestamp%3D1273667336%26oauth_token%3DOAUTH_TOKEN
%26oauth_version%3D1.0%26status%3Dtest%3A%2012-May-10%2009%3A28%3A56

and here's my Authorization header:
OAuth oauth_nonce=f897b67a-fb03-42fe-aa97-aec348f32f9c,
oauth_signature_method=HMAC-SHA1, oauth_timestamp=1273667336,
oauth_consumer_key=CONSUMER_KEY, oauth_token=OAUTH_TOKEN,
oauth_signature=PlvMUChsc4ftZCjxL8oaTQnGhbQ%3D, oauth_version=1.0

I'm also adding status=the status to the body of the request... I
believe I'm doing everything detailed here: 
http://developer.twitter.com/pages/auth#auth-request
but still no luck.

Any tip would be appreciated.
TIA,
seba


[twitter-dev] Re: I can't get update status using xAuth to work :(

2010-05-12 Thread @sebagomez
Hello Cameron, thanks for your tips.
I fixed my signature base string (concatening string suck!). You were
also right about the return message, I get a Incorrect signature.

I have a couple of questions... why do you say my status is not
encoded correctly? it workrd for every other string I have to encode
(url, consumer key, etc)
What should I write in the request's body? I'm adding status=my
status all that encoded in the same way I did before...

Is there a problem with that?

Thanks for you help

On May 12, 9:57 am, Cameron Kaiser spec...@floodgap.com wrote:
  I have the access_token with no problem, so now I have my oauth_token
  and my oauth_token_secret, but every time I want to update my status I
  get a 401... what am I doing wrong?

  Here's my signature base string:
  POSThttp%3A%2F%2Fapi.twitter.com%2F1%2Fstatuses%2Fupdate.xml
  oauth_consumer_key%3DCONSUMER_KEY%26oauth_nonce%3Df897b67a-fb03-42fe-
  aa97-aec348f32f9c%26oauth_signature_method%3DHMAC-
  SHA1%26oauth_timestamp%3D1273667336%26oauth_token%3DOAUTH_TOKEN
  %26oauth_version%3D1.0%26status%3Dtest%3A%2012-May-10%2009%3A28%3A56

  and here's my Authorization header:
  OAuth oauth_nonce=f897b67a-fb03-42fe-aa97-aec348f32f9c,
  oauth_signature_method=HMAC-SHA1, oauth_timestamp=1273667336,
  oauth_consumer_key=CONSUMER_KEY, oauth_token=OAUTH_TOKEN,
  oauth_signature=PlvMUChsc4ftZCjxL8oaTQnGhbQ%3D, oauth_version=1.0

 The return message should list what the problem is (Invalid nonce, Invalid
 signature, etc.). However, I do see a couple things:

 - probably a typo: oauth_token= should be oauth_token=

 - your status in your sig base does not look like it is encoded correctly.
   It should be

 ...%26status%3Dtest%253A%252012-May-10%252009%253A28%253A56

 (done by eye)

 --
  personal:http://www.cameronkaiser.com/--
   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
 -- A penny saved is stupid. 
  Hide quoted text -

 - Show quoted text -


[twitter-dev] Re: I can't get update status using xAuth to work :(

2010-05-12 Thread @sebagomez
GOT IT!

Thanks!

On May 12, 10:40 am, Cameron Kaiser spec...@floodgap.com wrote:
  Hello Cameron, thanks for your tips.
  I fixed my signature base string (concatening string suck!). You were
  also right about the return message, I get a Incorrect signature.

  I have a couple of questions... why do you say my status is not
  encoded correctly? it workrd for every other string I have to encode
  (url, consumer key, etc)
  What should I write in the request's body? I'm adding status=my
  status all that encoded in the same way I did before...

  Is there a problem with that?

 Here's what should be happening. Let's take madam, I'm Adam as our example.

 For your POST body, it is URL-encoded (and you do pass this as your POST):

         status=madam%2C%20I%27m%20Adam

 For your sig base, however, it needs to be URL-encoded a *second time*:

         status%3Dmadam%252C%2520I%2527m%2520Adam

 and you add that into your sig-base.

 Obviously both times the encoding is done according to the OAuth rules.

 What you had originally

         status%3Dtest%3A%2012-May-10%2009%3A28%3A56

 does not look like you properly encoded it the second time for the sig base.

 --
  personal:http://www.cameronkaiser.com/--
   Cameron Kaiser * Floodgap Systems *www.floodgap.com* ckai...@floodgap.com
 -- Jesus loves you, and I'm trying to. -- Jack Thompson 
 ---