.net - Get user's email address from Twitter with C# and OAuth -


i have app whitelisted on twitter able obtain email address when log in , i'm using tweetsharp library authenticate users, don't see way pass in parameter request email address using library. know it's old library , think requesting user's email relatively new maybe it's not possible w/o digging through source, updating , recompiling assembly?

if has been able accomplish tweetsharp, please let me know.

tia

after digging through source of tweetsharp bit, got lost in layer upon layer upon layer...like trying find needle in 20 haystacks. appreciate link tweetinvi linvi, decided exercise brain bit evening , see if write scratch.

i spent time looking on find on twitter , way oauth beyond funky. found php solution handles oauth , tweaked bit make return email address. armed that, translated php c# , got working in own home baked solution.

i posted working solution here: http://www.burritostand.com/log-in-to-twitter-with-oauth-and-c-sharp-and-get-twitter-user-email

it needs major refactoring make production-worthy implementation, thought might useful others breaks down different processes pretty clearly. else can make use of it.

the critical piece (for retrieving email) in twitterclient class, in parameter list:

        twitterurls twitterurls = new twitterurls("https://api.twitter.com/1.1/account/verify_credentials.json");         list<keyvaluepair<string, string>> parameters = new list<keyvaluepair<string, string>>();         parameters.add(new keyvaluepair<string, string>("include_email", "true")); // important part getting email returned         parameters.add(new keyvaluepair<string, string>("oauth_consumer_key", consumerkey));         parameters.add(new keyvaluepair<string, string>("oauth_nonce", nonce));         parameters.add(new keyvaluepair<string, string>("oauth_signature_method", "hmac-sha1"));         parameters.add(new keyvaluepair<string, string>("oauth_timestamp", timestamp));         parameters.add(new keyvaluepair<string, string>("oauth_token", dict["oauth_token"]));         parameters.add(new keyvaluepair<string, string>("oauth_version", oauthversion)); 

i appreciate answers , did have fun going php tonight...been looooong time :)


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -