This project has moved and is read-only. For the latest updates, please go here.

Get Profile Photo

Mar 18, 2013 at 12:27 AM
Hi, I'm having trouble getting a User's profile picture url. I know you need to use the User class but no matter how I declare it I cannot get anything like User.ProfileImageURL popping up with Intellitext. Its almost like the class is empty, however I assume I am doing something wrong.

How would I declare a User for the currently authenticated user from the active TwitterContext in order to access these properties?
Mar 18, 2013 at 12:33 AM

TwitterContext.User is a queryable entity, IQueryable<User>. You need to perform a query to get user details, probably a User/Show query in this case. Here's a quick example:
            var users =
                from tweet in twitterCtx.User
                where tweet.Type == UserType.Show &&
                      tweet.ScreenName == "JoeMayo"
                select tweet;

            var user = users.SingleOrDefault();
Mar 18, 2013 at 12:41 AM
Works perfectly, thanks again.