[Qt-interest] any hint for uploading a picture to facebook/twitter?

Ian Clark mrrooster at gmail.com
Thu Apr 7 14:19:52 CEST 2011


Gah, sent to wrong address!


---------- Forwarded message ----------
From: Ian Clark <mrrooster at gmail.com>
Date: 7 April 2011 13:18
Subject: Re: [Qt-interest] any hint for uploading a picture to facebook/twitter?
To: James Yan <james.pizza at gmail.com>


On 1 April 2011 21:55, James Yan <james.pizza at gmail.com> wrote:
> Hey All,
>
> i thought it will be as easy as sending the picture as mail attachment, after googling, seems not that case.
> any helpful Qt class or some other suggestions for it?
>
I've written a twitter client in Qt (shameless plug: yasst.org), that
supports this, however as you've probably discovered it is quite tied
into the whole twitter process because of OAuth.

http://dev.twitpic.com/docs/ contains more specific details

Basically the process boils down to creating a valid OAuth header that
twitpic can verify with twitter, then sending the image and some
metadata to twitpic along with the OAuth header as a multipart form
message.

Twitpic then returns you the URL for you to include in your tweet to twitter.

I'm not sure about facebook, I would assume it's along the same lines.

I've just looked at my code and it's all quite heavily intertwined so
I've not got anything handy I can really cut and paste, but I needed
to understand OAuth and HTTP multipart form encoding before I could
get this to work.

If there's any interest I could maybe put a GPL version of the source
somewhere but it is a hobby project so it's possibly not 'production
quality' code.

Cheers,

Ian



More information about the Qt-interest-old mailing list