How to send a message from twitter using WP7 C #?

I was looking for a solution to post to twitter from a wp7 application, but found very limited resources on this. Everything seems to be in a different programming language (e.g. PHP) or on a platform (ASP.NET) or there is no documentation.

These questions did NOT work for WP7:

Post to Twitter using C # app

Twitter post C # API

Post tweets to Twitter from FaceBook using ASP.Net C #

Are there any resources, code examples, or posts that talk about how to get started with the Twitter API for WP7?

Also, are there any specific libraries that are well-documented that support WP7?

Thanks.

+7
source share
3 answers

Codeplex has several complete twitter apps.

I think both of them also have blogs / documentation related to it that can help - for example. http://samjarawan.blogspot.com/2010/10/building-real-windows-phone-twitter-app_07.html

+6
source

One popular Twitter library for .Net is TweetSharp . They have a Windows Phone 7 compatible library, they have a section that shows sample code for Windows Phone 7. The example shows how to use the TweetSharp library to extract your mentions and publish a sample tweet.

If TweetSharp is not suitable for you, check out the Twitter Libraries.NET section of the Twitter developers site for another library with Windows Phone compatablity.

+7
source

The fastest and easiest way is to use the Twitter API Twitter. This will force the user to leave the page, but allow them to change the tweets as they like. You might be able to make this a little cleaner by inserting a WebBrowser element into your form and making it visible when reading.

Here is the code I'm using:

public class ShareTwitter { // DOCS: http://dev.twitter.com/pages/tweet_button private const string URL = "http://twitter.com/share?url={0}&via={1}&text={2}"; public static void Open(string link, string via, string text) { WebBrowserTask t = new WebBrowserTask(); t.URL = String.Format(URL, HttpUtility.UrlEncode(link), HttpUtility.UrlEncode(via), HttpUtility.UrlEncode(text)); t.Show(); } } 

I have similar classes for Facebook, ReadItLater and email for Windows Phone - let me know if you are also interested in this.

+1
source

All Articles