public bool login(OAuthToken oAuthToken) { if (oAuthToken.isNull()) { "[O2TwitterApi] in login, provided OAuthToken parameter was null".error(); return(false); } try { OAuthToken = oAuthToken; "login to Twitter via OAuth under user:{0}".info(oAuthToken.ScreenName); this.Twitter = FluentTwitter.CreateRequest() .AuthenticateWith(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, oAuthToken.Token, oAuthToken.TokenSecret); var response = this.Twitter.Account().VerifyCredentials().AsJson().Request(); IsLoggedIn = response.ok(); if (IsLoggedIn) { this.Statuses = this.Twitter.Statuses(); this.UserLoggedIn = response.AsUser(); "Sucessfully connected to twitter user: '******' (id:{1})".info(this.UserLoggedIn.Name, this.UserLoggedIn.Id); } else { "Failed to connect to twitter user {0}".error(Username); } return(IsLoggedIn); } catch (Exception ex) { ex.log("[in O2TwitterAPI.login"); } return(false); }