Retrieving User Location

Jul 17, 2009 at 12:19 PM

Hi,

I understand that from demo program.cs of the method "FirstStatusQueryDemo" I can get user's information such as location and name.

By using this example, I hitting error when I try with a twitter user which has ZERO tweet (never tweet) and it hit collection error which I think is normal and understandable.

Is there anyway to retrieve status.user object by not query by first status?

Thanks

Ervin

Coordinator
Jul 17, 2009 at 2:14 PM

Hi Ervin,

There is also a User object that will give you the user information and attach the last status (if there is one):

 var users =
                from tweet in twitterCtx.User
                where tweet.Type == UserType.Show &&
                      tweet.ID == "15411837"
                select tweet;

You can also use screen name:

 var users =
                from tweet in twitterCtx.User
                where tweet.Type == UserType.Show &&
                      tweet.ScreenName == "JoeMayo"
                select tweet;

The User.Status property will be null if they don't have any statuses.

Joe