/// <summary> /// FriendsStatusOfUser /// </summary> /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param> /// <param name="ScreenName">User Screen Name</param> /// <returns></returns> /// <summary> /// FollowersStatusOfUser /// </summary> /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param> /// <param name="ScreenName">User Screen Name</param> /// <returns></returns> #endregion /// <summary> /// Sends Direct Messages to a twitter User whose ScreenName is passed /// </summary> /// <param name="OAuth"></param> /// <param name="DirectMessage"></param> /// <param name="ScreenName">Twitter ScreenName</param> /// <returns>boolean</returns> public bool SendDirectMessagebyScreenName(oAuthTwitter OAuth, string DirectMessage, string ScreenName) { Twitter.Core.DirectMessageMethods.DirectMessage directMessage = new Twitter.Core.DirectMessageMethods.DirectMessage(); xmlResult = directMessage.SendDirectMessage(OAuth, DirectMessage, ScreenName); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("direct_message"); if (xmlNodeList.Count > 0) { return true; } return false; }
/// <summary> /// Destroys the direct message specified in the required ID parameter. /// </summary> /// <param name="oAuth"></param> /// <param name="directMessageId"></param> /// <returns></returns> public JArray PostDirect_Messages_Destroy_ById(oAuthTwitter oAuth, string directMessageId) { DirectMessage objDM = new DirectMessage(); JArray jobjDMS = new JArray(); jobjDMS = objDM.Post_Direct_Messages_Destroy_ById(oAuth, directMessageId); return jobjDMS; }
/// <summary> /// Sends a new direct message to the specified user from the authenticating user. /// </summary> /// <param name="oAuth"></param> /// <param name="textMessage"></param> /// <returns></returns> public JArray PostDirect_Messages_New(oAuthTwitter oAuth, string textMessage, string userId) { DirectMessage objDM = new DirectMessage(); JArray jobjDMN = new JArray(); jobjDMN = objDM.Post_Direct_Messages_New(oAuth, textMessage, userId); return jobjDMN; }
/// <summary> /// Returns a single direct message, specified by an id parameter. /// </summary> /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param> /// <param name="directMessageId">ID Of DirectMessage</param> /// <returns></returns> public JArray GetDirect_Messages_Show_ById(oAuthTwitter oAuth, string directMessageId) { DirectMessage objDM = new DirectMessage(); JArray jobjDMS = new JArray(); jobjDMS = objDM.Get_Direct_Messages_Show_ById(oAuth, directMessageId); return jobjDMS; }
/// <summary> /// Returns the most recent direct messages sent by the authenticating user. Includes detailed information about the sender and recipient user. /// </summary> /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param> /// <param name="Count">Number Of DirectMessage</param> /// <returns></returns> public JArray GetDirect_Messages_Sent(oAuthTwitter oAuth, int count) { DirectMessage objDM = new DirectMessage(); JArray jobjDMS = new JArray(); jobjDMS = objDM.Get_Direct_Messages_Sent(oAuth, count); return jobjDMS; }
/// <summary> /// Get All Direct Messages Of User. /// </summary> /// <param name="OAuth">OAuth Keys Token, TokenSecret, ConsumerKey, ConsumerSecret</param> /// <param name="Count">Number Of Direct Messages</param> /// <returns>Return List Of DirectMessage</returns> public List<direct_messages> GetDirectMessages(oAuthTwitter OAuth, string Count, SortedDictionary<string, string> strdic) { direct_messages direct_Messages = new direct_messages(); Twitter.Core.DirectMessageMethods.DirectMessage directMessage = new Twitter.Core.DirectMessageMethods.DirectMessage(); xmlResult = directMessage.DirectMessages(OAuth, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("direct_message"); foreach (XmlNode xn in xmlNodeList) { XmlElement idElement = (XmlElement)xn; direct_Messages.Id = idElement.GetElementsByTagName("id")[0].InnerText; XmlElement sender_idElement = (XmlElement)xn; direct_Messages.sender_id = sender_idElement.GetElementsByTagName("sender_id")[0].InnerText; XmlElement created_atElement = (XmlElement)xn; direct_Messages.created_at = created_atElement.GetElementsByTagName("created_at")[0].InnerText; XmlElement sender_screen_nameElement = (XmlElement)xn; direct_Messages.sender_screen_name = sender_screen_nameElement.GetElementsByTagName("sender_screen_name")[0].InnerText; XmlElement recipient_screen_nameElement = (XmlElement)xn; direct_Messages.recipient_screen_name = recipient_screen_nameElement.GetElementsByTagName("recipient_screen_name")[0].InnerText; XmlElement textElement = (XmlElement)xn; direct_Messages.Description = textElement.GetElementsByTagName("text")[0].InnerText; XmlElement screenNameElement = (XmlElement)xn; direct_Messages.senderObject.ScreenName = screenNameElement.GetElementsByTagName("screen_name")[0].InnerText; XmlElement imageUrlElement = (XmlElement)xn; direct_Messages.senderObject.ProfileImageUrl = new Uri(imageUrlElement.GetElementsByTagName("profile_image_url")[0].InnerText); XmlElement followersCountElement = (XmlElement)xn; direct_Messages.senderObject.FollowersCount = int.Parse(followersCountElement.GetElementsByTagName("followers_count")[0].InnerText); XmlElement friendCountElement = (XmlElement)xn; direct_Messages.senderObject.FriendsCount = int.Parse(friendCountElement.GetElementsByTagName("friends_count")[0].InnerText); XmlElement statusElement = (XmlElement)xn; direct_Messages.senderObject.StatusesCount = int.Parse(statusElement.GetElementsByTagName("statuses_count")[0].InnerText); DirectMessages.Add(direct_Messages); } return DirectMessages; }
public bool NewDirectMessage(oAuthTwitter OAuth, string DirectMessage, int UserId) { Twitter.Core.DirectMessageMethods.DirectMessage directMessage = new Twitter.Core.DirectMessageMethods.DirectMessage(); xmlResult = directMessage.NewDirectMessage(OAuth, DirectMessage, UserId); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("direct_message"); if (xmlNodeList.Count > 0) { return true; } return false; }
/// <summary> /// Sends a new direct message to the specified user from the authenticating user. /// </summary> /// <param name="oAuth"></param> /// <param name="textMessage"></param> /// <returns></returns> public JArray PostDirect_Messages_New(oAuthTwitter oAuth, string textMessage) { DirectMessage objDM = new DirectMessage(); JArray jobjDMN = new JArray(); jobjDMN = objDM.Post_Direct_Messages_Destroy_ById(oAuth, textMessage); return jobjDMN; }