private void btnTweet_Click(object sender, EventArgs e) { TweetActions tweetActions = new TweetActions(this.Tokens); TwitterStatus status = tweetActions.UpdateStatus(txtTweet.Text); if (status == TwitterStatus.Success) MessageBox.Show("You updated your status successfully"); else MessageBox.Show("Something went wrong", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); txtTweet.Text = ""; }
protected void Button3_Click(object sender, EventArgs e) { OAuthTokens tokens = (OAuthTokens)Session["OAuthTokens"]; TweetActions tweet = new TweetActions(tokens); TwitterStatus status=tweet.UpdateStatus(txtStatus.Text); }
protected void Button2_Click(object sender, EventArgs e) { OAuthTokens tokens = (OAuthTokens)Session["OAuthTokens"]; #region TwitterUser TwitterUserActions twitterObject = new TwitterUserActions(tokens); TwitterResponse<TwitterUser> twitterResponse = twitterObject.GetUserInfo(txtUser.Text); if (twitterResponse.Status == TwitterStatus.Success) { TwitterUser user = twitterResponse.ObjectResponse; StringBuilder sb = new StringBuilder(); sb.AppendFormat("<h3>{0}</h3>", user.Name) .AppendFormat("</br><img src=\"{0}\" /> @{1}", user.ProfileImageUrl, user.ScreenName) .AppendFormat("</br>Description:{0}", user.Description) .AppendFormat("</br>Location: {0}", user.Location) .AppendFormat("</br>Followers:{0} Favorited tweets:{1}", user.FollowersCount, user.FavouritesCount) .AppendFormat("</br>Verified:{0}",user.Verified.ToString()); infoUser.InnerHtml = sb.ToString(); } else if (twitterResponse.Status == TwitterStatus.FileNotFound) { infoUser.InnerText = "No se encontro el usuario o ocurrio otra cosa"; } else { infoUser.InnerText = "Ya valio, no se que paso "; } #endregion #region Favourited //FavoriteActions favourites = new FavoriteActions(tokens); //TwitterResponse<List<Tweet>> response = favourites.GetTweets(268126545946759169); //gridFav.DataSource = response.ObjectResponse; //gridFav.DataBind(); #endregion #region homeTimeline TimelineActions actionsTimeline = new TimelineActions(tokens); //TwitterResponse<List<Tweet>> responseTimeline = actionsTimeline.GetHomeTimeline(); //max //TwitterResponse<List<Tweet>> responseTimeline = actionsTimeline.GetHomeTimeline(5, 268480111941124097); //since //TwitterResponse<List<Tweet>> responseTimeline = actionsTimeline.GetHomeTimeline(268480111941124097); #endregion #region Search user //TwitterResponse<List<TwitterUser>> usersss= twitterObject.Search(txtUser.Text, 1,10); #endregion #region Search Tweets TweetActions tweetActions = new TweetActions(tokens); var response = tweetActions.SearchTweets("_ballonatic"); #endregion }