Finding Twitter User Profile Information Using DotNetOpenAuth

How to find details, for example:

  • tongue
  • Image Profile URL
  • Timezone

I use this code for authentication only. Callback works great!

How can I go beyond authentication with DotNetOpenAuth to get profile information?

public bool FinishAuthentication() { using (var twitter = new WebConsumer(ServiceDescription, _tokenManager)) { var accessTokenResponse = twitter.ProcessUserAuthorization(); if (accessTokenResponse != null) { string userName = accessTokenResponse.ExtraData["screen_name"]; string id = accessTokenResponse.ExtraData["user_id"]; //-----how can we get all the other profile info?----- GetProfileDetails(id); return true; } } return false; } public void GetProfileDetails(string id) { //unsure how to implement with DotNetOpenAuth. } 

Source of code .

+4
source share
2 answers

If you are just trying to authenticate a user and retrieve his data, I would use something like TweetSharp . You can authenticate users as a web application or a desktop application, and you will have access to methods for obtaining information about users, relationships, mentions, etc. This will be much faster than trying to analyze Twitter responses yourself.

Here is their documentation that shows how easy it is to use TweetSharp: http://tweetsharp.codeplex.com/documentation

Alternatively, you can continue authentication as it is now, and just use TweetSharp (with a user access token) to pull out the data you need.

Edited to add more specific information on your subject:

TweetSharp offers a GetUserProfileFor (int userId) method that returns a TwitterUser object that contains their TimeZone, image profile URL, langauge, location, etc.

+4
source

I studied this, and what I have found so far is the following. There is a site that provides an ASP.NET tutorial on how to set up a connection using DotNetOpenAuth. Here is a link to it:

http://bhaidar.net/post/2011/04/04/OpenID-Single-Sign-On-ASPNET-Web-Forms.aspx

Here is the site with which it is linked to find extended information on what can be provided for download:

http://openid.net/specs/openid-simple-registration-extension-1_0.html

0
source

All Articles