i wrote a simple ruby script and posted it at
http://mehack.com/uploading-a-background-image-to-twitter-using (which may
be having DNS issues at the moment, and if so, just go see the code directly
at http://gist.github.com/279650) -- that code demonstrates how to construct
the oauth signature and upload a background image to Twitter.  i tested it
on my test account, and it seems to work well.

while that code is written in ruby, i tried to take care to write it clearly
enough so that even non-ruby programmers should be able to follow it.  let
me know if there are any questions!

ps. as yusuke mentioned earlier on this thread, Twitter4J (
http://yusuke.homeip.net/twitter4j/en/index.html) has support for setting
background images via OAuth.  FWIW, that library is -very- clearly written,
and should be relatively easy for programmers (especially those who are
attempting to construct their own OAuth signatures) to follow.

On Wed, Jan 13, 2010 at 9:40 AM, Vikram <vikram.prav...@gmail.com> wrote:

> Raffi,
> After modifications, this is how my request looks like
> OAuth signature base:
> POST&http%3A%2F%2Ftwitter.com%2Faccount
> %2Fupdate_profile_background_image.xml&oauth_consumer_key
> %3DgUutCG9HjEOT0N8IxvW9w%26oauth_nonce
> %3Dt64bID6gIVtpU6t7m3dsTrTUOhubJizM%26oauth_signature_method%3DHMAC-
> SHA1%26oauth_timestamp%3D1263403749%26oauth_token
> %3D29191067-7Gl0rjc5KegDdw5p0FJqcBLTmKFF8rCr9Kb3Yt7ZE%26oauth_version
> %3D1.0a
> I sign this and then add all the parameters to the request stream,
> this is how my stream looks like:
> oauth_consumer_key=gUutCG9HjEOT0N8IxvW9w&oauth_nonce=t64bID6gIVtpU6t7m3dsTrTUOhubJizM&oauth_signature=TE0lfX3WZwYAr1812GNP8uYJGKc
> %3D&oauth_signature_method=HMAC-
> SHA1&oauth_timestamp=1263403749&oauth_token=29191067-7Gl0rjc5KegDdw5p0FJqcBLTmKFF8rCr9Kb3Yt7ZE&oauth_version=1.0a&image=
> This is followed by the byte stream of the image.
> I still get a 401 as response.
> Can tell me what I need to change?

Raffi Krikorian
Twitter Platform Team

Reply via email to