views:

230

answers:

2

I am working on a method that will allow me to pull in the 5 most recent posts that my company has made on it's Twitter account.

One requirement of this web application is that it present these twitter posts as "regular" html in our website, so using the Twitter javascript method is ruled out.

I have found Tweet#, a C# plugin that exposes the Twitter commands. This seems to be a nice way to pull this information but I have a question.

I would like to be able to pull these updates from Twitter without authenticating to Twitter. Since the information is publically available I would think this would be fairly simple, however I'm having a problem with Tweet# wanting to do this.

The closest thing I have found to be able to do this requires my to login/authenticate with Twitter and then pull the 5 most recent tweets. Like this:

            var twitter = FluentTwitter.CreateRequest()
            .AuthenticateAs("UserName", "p@ssw0rd")
            .Configuration.CacheForInactivityOf(60.Seconds())
            .Statuses().OnUserTimeline().Take(5).AsJson();

What I need is something that will allow my to specific the user id to pull the most recent 5 tweets from without authentication.

A: 

Something like this might be what your looking for: Integrate Twitter into your blog

GrayWizardx
+2  A: 

Tweet# isn't particularly well documented. I think this will work:

FluentTwitter.CreateRequest().Statuses().OnUserTimeline().For(USERNAME);

This is analogous to the web request

http://api.twitter.com/1/statuses/user_timeline.xml?screen_name=USERNAME

...so if all else fails, you could manually download and XML parse that content.

rjh
Your solution works perfectly! I agree the documentation is not very complete, but it does seem to work. Thanks!
Richard West
We're working on docs so they should be a lot better soon. If you're ever stuck, look in the unit tests. They make great examples.
Jason Diller