The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
How to upload an image to twitter? RRS feed

  • General discussion

  • I'm attempting to upload a photo to twitter on windows phone. As you probably noticed the most used libraries don't provide the methods for uploading photos (or media) to twitter.

    I have gotten pretty far though. As of right now I have successfully signed into twitter and have recieved the AccessToken along with the AccessTokenSecret. I was also able to break down the image into binary data so I could upload this to twitter.  Now while I was looking around I discovered that the url we should be posting to is:

    https://upload.twitter.com/1/statuses/update_with_media.xml

    Now I know I'm going to have to upload this the manual way so I had a question as to how to approach this. Am I supposed to use an HttpWebRequest to POST this to the twitter url? And if so how do I pass in the credentials (tokens)?

    One thing that threw me off was when I saw this project. It required a secondary class called OAuth.Manager. Is this class neccessary to generate an AuthorizationHeader? Because unfortunately right now it contains quite a bit of methods that aren't compatible with WP7.

    One of the problem is that up to this point I have been using TweetSharp to pretty much handle all my requests so I'm a little new to manually sending requests to Twitter. I did find Den's project here where he goes over how to manually send a tweet. I can't help but think that this could be modified to send an image with it. Has anyone worked on this before that could provide some direction.

    Tuesday, June 5, 2012 11:28 PM