Esempio n. 1
0
        private StringBuilder GenTimeline(Twitter twitter, StringBuilder sb)
        {
            sb.Append("Say something<br />");
            sb.Append("<form method=\"post\">");
            sb.Append("<input type=\"text\" name=\"message\"></input>");
            sb.Append("<input type=\"submit\" name=\"action\" value=\"tweet\" /> <br />");
            sb.Append("</form>");
            sb.Append("Follow someone<br />");
            sb.Append("<form method=\"post\">");
            sb.Append("<input type=\"text\" name=\"following\"></input>");
            sb.Append("<input type=\"submit\" name=\"action\" value=\"following\" /> <br />");
            sb.Append("</form>");
            sb.Append(String.Format("<h3><b>{0}</b>'s timeline</h3><br />", twitter.GetUsername()));
            List <Tweet> tweets = twitter.GetUserTimeline();

            foreach (Tweet tweet in tweets)
            {
                sb.Append("[" + tweet.DateCreated + "]" + tweet.User + ":" + tweet.Message + "<br />");
            }
            sb.Append("<br /><br />");
            sb.Append("<h3>Following timeline</h3><br />");
            tweets = twitter.GetFollowingTimeline();
            if (tweets == null)
            {
                sb.Append("Your following list is empty, follow someone!");
            }
            else
            {
                foreach (Tweet tweet in tweets)
                {
                    sb.Append("[" + tweet.DateCreated + "] " + tweet.User + ":" + tweet.Message + "<br />");
                }
            }
            return(sb);
        }