Esempio n. 1
0
        /// <summary>
        /// Get User Status
        /// </summary>
        /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param>
        /// <param name="Count">ScreenName Of User</param>
        /// <returns>Return List Of User Detail</returns>
        public List <status> GetStatusOfUser(oAuthTwitter OAuth, string ScreenName)
        {
            status objStatus = new status();

            Twitter.Core.StatusMethods.Status status = new Twitter.Core.StatusMethods.Status();
            xmlResult = status.ShowStatusByScreenName(OAuth, ScreenName);
            XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("user");

            foreach (XmlNode xn in xmlNodeList)
            {
                XmlElement imageUrlElement = (XmlElement)xn;
                objStatus.userObject.ProfileImageUrl = new Uri(imageUrlElement.GetElementsByTagName("profile_image_url")[0].InnerText);

                XmlElement followersCountElement = (XmlElement)xn;
                objStatus.userObject.FollowersCount = int.Parse(followersCountElement.GetElementsByTagName("followers_count")[0].InnerText);

                XmlElement friendCountElement = (XmlElement)xn;
                objStatus.userObject.FriendsCount = int.Parse(friendCountElement.GetElementsByTagName("friends_count")[0].InnerText);

                XmlElement statusElement = (XmlElement)xn;
                objStatus.userObject.StatusesCount = int.Parse(statusElement.GetElementsByTagName("statuses_count")[0].InnerText);

                StatusTimeLine.Add(objStatus);
            }
            return(StatusTimeLine);
        }
        /// <summary>
        /// This Method Will Update Tweets On Twitter
        /// </summary>
        /// <param name="User">Twitter UserName And Password</param>
        /// <param name="StatusText">Status Messages</param>
        /// <returns>Return True If Stuatus Sent SuccessFully</returns>
        public bool UpdateStatus(TwitterUser User, string StatusText)
        {
            Twitter.Core.StatusMethods.Status status = new Twitter.Core.StatusMethods.Status();
            xmlResult = status.UpdateStatus(User, StatusText);
            XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("id");

            if (xmlNodeList.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
 /// <summary>
 /// ReTweet
 /// </summary>
 /// <param name="twitterUser">Twitter UserName And Password</param>
 /// <param name="UserToFollow">TweetId</param>
 /// <returns>Returm True If ReTweet Success</returns>
 public bool ReTweetStatus(TwitterUser twitterUser, string TweetId)
 {
     try
     {
         Twitter.Core.StatusMethods.Status status = new Twitter.Core.StatusMethods.Status();
         xmlResult = status.ReTweetStatus(twitterUser, TweetId);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 4
0
 public bool UpdateStatus(oAuthTwitter oAuth, string StatusText, string reply)
 {
     try
     {
         Twitter.Core.StatusMethods.Status status = new Twitter.Core.StatusMethods.Status();
         xmlResult = status.UpdateStatus(oAuth, StatusText, reply);
         XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("id");
         if (xmlNodeList.Count > 0)
         {
             return(true);
         }
     }
     catch (Exception ex)
     {
     }
     return(false);
 }