2

I'm introducing myself to tweetsharp for a web application I am working on. Does anyone have any example code or know where any is? I'm not sure that this is the proper forum for this question, but I've been searching all night and I can't find anything current. Most of them use older versions of TweetSharp and no longer apply.

If not, maybe I can get some guidance.

I'm trying to get OAuth going, and so far the only good guide I've found is via the TweetSharp getHub project's readme. The following code throws me off:

  ViewModel.Message = string.Format("Your username is {0}", user.ScreenName);
    return View();

Do I need to be using an MVC application? I'm not familiar with viewmodels.

It'd be nice to have a complete walkthrough or example for authorization if anyone can help me out. It'd be nice if it were for web, but anything would help at this point.

MCwa
  • 87
  • 1
  • 6

1 Answers1

2

That's a very broad question, and the answer is going to depend on the tech you're using for your web app. I just started looking at TweetSharp + OAuth for a client app today, and what helped me was comparing the examples on the TweetSharp github page with the API docs at dev.twitter.com.

This link was especially useful to me: https://dev.twitter.com/docs/auth/obtaining-access-tokens. From there, pick the type of sign-in experience you want to provide, and follow the required steps.

Translating from the raw API to TweetSharp calls is trivial - there's a 1:1 mapping from raw API name to TweetSharp method name. For instance, when the Twitter docs say to call:

POST /oauth/request_token HTTP/1.1

The corresponding TweetSharp call is:

OAuthRequestToken requestToken = service.GetRequestToken();
drwestco
  • 142
  • 1
  • 9