开发者

Using Tweet# to pull 5 most recent updates from a user

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 metho开发者_开发技巧d 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜