tags:

views:

390

answers:

4

A few days ago, I posted this question and this question asking about how to post "Hello World" to twitter. I've gotten helpful responses, which have propelled me further along, but I'm still lost.

I need to use OAuth because (as I read it) using username and password is going to be deprecated soon.

I need an example as simple as updating the status with the string constant 'Hello World!'.

My client is specifying that I must use C#.

+1  A: 

What API are you using? have you tried Twitterizer. It should be relatively simple to do.

James
I really liked Twitterizer as well, but what stopped me is that it seems to only work in full trust mode, which (stupid me) I have GoDaddy as my hosting provider, so that's a no-go.
Joe Enos
I was going to say that Twitterizer doesn't support OAuth, but apparently Twitterizer2 does! http://www.twitterizer.net/tutorials/getting-started-with-oauth/
Dave
Joe: I don't understand how GoDaddy as a hosting provider fits here. Are you hosting a C# program via GoDaddy? What?
cf_PhillipSenn
@cf_PhillipSenn: I have ASP.NET websites that are hosted on GoDaddy, so they are just running normal .NET code. When I wrote an app that used Twitterizer, the app bombed out because it required full trust. I did eventually get it to work with a slightly modified version of Linq2Twitter instead of Twitterizer.
Joe Enos
@cf_PhillipSenn: To clarify, since it looks like you're not a .NET guy, C# is one of many languages that compile to .NET code. That .NET code can run in a console app, Windows form, or ASP.NET app (or lots of other types). So the Twitterizer library can be plugged into any type of .NET app, including ASP.NET, and function the exact same way. However, with ASP.NET, in order to do some specific things (reflection, security permission, etc.), you need to run in "full trust", which GoDaddy doesn't allow. So the same DLL that worked in my console app, didn't work once published to the website.
Joe Enos
+2  A: 

I highly recommend that you use TweetSharp. It is very robust, supports the scenario you specify above (uses OAuth to authenticate).

I've used it on a few pet projects and I've been extremely happy with it. The download comes with a WPF sample application that shows you how to use twitter's OAuth implementation.

Nate Bross
+10  A: 

Definitely use Linq2Twitter -

http://linqtotwitter.codeplex.com/

It's UpdateStatus method has 11 overloads - the whole implementation is really nice. So you're example would be:

var tweet = twitterCtx.UpdateStatus("Hello world");
stupid-phil
@stupid-phil - I've used this! Very very good! Give this man the Rep!
Neurofluxation
+1 for a solution using LINQ :)
James
Thanks Phil! Now: What is linq?
cf_PhillipSenn
I'm having a tough time with Linq2Twitter...It seems to also require full trust - seems to be from the Kerr.Credentials piece of it. Do you know if there's a way to either get Linq2Twitter working in medium trust (aka GoDaddy), or a medium trust alternative?
Joe Enos
@cf_PhillipSenn - LINQ will change your life:http://msdn.microsoft.com/en-us/netframework/aa904594.aspx
stupid-phil
@Joe Enos - it's not been a problem for me, but here's a link (no pun intended!) that might help http://linqtotwitter.codeplex.com/WorkItem/View.aspx?WorkItemId=24501
stupid-phil
@stupid-phil - Thanks, I'll take a look and see if that helps.
Joe Enos
@stupid-phil - Before I even got that far, I tried something different - I removed the Kerr.Credentials DLL, built my own TokenManager, and everything worked perfectly the first try. I like that better for my scenario anyway, since I'm in full control over the keys and secrets.
Joe Enos
A: 

I am having issues with TweetSharp.Twitter on Godaddy.

The error 'That assembly does not allow partially trusted callers' is causing issues for me. Any workarounds??

thx

InnerException: null Message: "That assembly does not allow partially trusted callers." Source: "TweetSharp.Twitter" StackTrace: " at TweetSharp.Twitter.Fluent.FluentTwitter..ctor(IClientInfo clientInfo)\r\n at TweetSharp.Twitter.Fluent.FluentTwitter.CreateRequest()\r\n at TwitterLib.MyTwitter.GetRequestToken()\r\n at TwitterLib.MyTwitter..ctor(String userName, String password)\r\n at Controls.Twitter.GetTimeLine()\r\n at Controls.Twitter.RenderControl(HtmlTextWriter writer)" TargetSite: {Void .ctor(TweetSharp.IClientInfo)}

David