How do I tweet, using the DotNetOpenAuth library?

2019-05-26 05:58发布

问题:

I just downloaded the DotNetOpenAuth library and ran the AuthConsumer demo. It is an excellent library so far! Everything worked as advertised, which has not been my experience with a lot of Facebook and Twitter sample code that I have been working with recently.

What I am trying to figure out is: How do I tweet using this library? I am currently planning to implement this in ASP MVC, but my initial thoughts is that the presentation platform doesn't matter all that much at the level I'm looking at.

回答1:

Take a look at the DotNetOpenAuth.ApplicationBlock sample, which includes the Twitter.cs file and the very few sample web method calls that that file has. You can see the pattern, and having looked at the Twitter API documentation on twitter.com, you can add methods to tweet and a bunch of other stuff.

However, it would probably be much easier for you to download LinqToTwitter, which uses DotNetOpenAuth and offers an extensive Twitter library to do most/all the operations Twitter supports.