public string SetStatusUpdate(oAuthLinkedIn OAuth, string message) { ShareAndSocialStream socialStream = new ShareAndSocialStream(); string responce = socialStream.SetStatusUpdate(OAuth, message); return(responce); }
public List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates> GetGroupUpdates(oAuthLinkedIn OAuth, int Count) { Domain.Socioboard.Domain.LinkedInGroup.Group_Updates group_Updates = new Domain.Socioboard.Domain.LinkedInGroup.Group_Updates(); List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates> GroupUpdatesList = new List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates>(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_GroupUpdates(OAuth, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("group-membership"); foreach (XmlNode xn in xmlNodeList) { try { XmlElement Element = (XmlElement)xn; //double timestamp = Convert.ToDouble(Element.GetElementsByTagName("timestamp")[0].InnerText); //network_Updates.DateTime = JavaTimeStampToDateTime(timestamp); try { group_Updates.id = Element.GetElementsByTagName("id")[0].InnerText; } catch { } try { group_Updates.GroupName = Element.GetElementsByTagName("name")[0].InnerText; } catch { } GroupUpdatesList.Add(group_Updates); } catch { } } return(GroupUpdatesList); }
public List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates> GetGroupPostData(oAuthLinkedIn OAuth, int Count, string groupid, string linkedinId) { Domain.Socioboard.Domain.LinkedInGroup.Group_Updates group_Updates = new Domain.Socioboard.Domain.LinkedInGroup.Group_Updates(); List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates> GroupUpdatesList = new List <Domain.Socioboard.Domain.LinkedInGroup.Group_Updates>(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_GroupPostData(OAuth, Count, groupid); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("post"); foreach (XmlNode xn in xmlNodeList) { try { XmlElement Element = (XmlElement)xn; try { group_Updates.LinkedInProfileId = linkedinId; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.id = groupid; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.GpPostid = Element.GetElementsByTagName("id")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.firstname = Element.GetElementsByTagName("first-name")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { string following = Element.GetElementsByTagName("is-following")[0].InnerText; if (following == "true") { group_Updates.isFollowing = 1; } else { group_Updates.isFollowing = 0; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { string like = Element.GetElementsByTagName("is-liked")[0].InnerText; if (like == "true") { group_Updates.isLiked = 1; } else { group_Updates.isLiked = 0; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.likes_total = Element.GetElementsByTagName("likes")[0].Attributes["total"].Value; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.comments_total = Element.GetElementsByTagName("comments")[0].Attributes["total"].Value; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.summary = Element.GetElementsByTagName("summary")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.lastname = Element.GetElementsByTagName("last-name")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.headline = Element.GetElementsByTagName("headline")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.pictureurl = Element.GetElementsByTagName("picture-url")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); group_Updates.pictureurl = "www.socioboard.com/Themes/" + System.Configuration.ConfigurationManager.AppSettings["domain"] + "/Contents/img/blank_img.png";//"../../Contents/img/blank_img.png"; } try { group_Updates.title = Element.GetElementsByTagName("title")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } GroupUpdatesList.Add(group_Updates); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } return(GroupUpdatesList); }
/// <summary> /// The Get Network Updates API returns the users network updates, which is the LinkedIn term for the user's feed. /// </summary> /// <param name="OAuth"></param> /// <param name="Count"></param> /// <returns></returns> public List <Network_Updates> GetNetworkUpdates(oAuthLinkedIn OAuth, int Count) { Network_Updates network_Updates = new Network_Updates(); //SocialStream socialStream = new SocialStream(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_NetworkUpdates(OAuth, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("update"); foreach (XmlNode xn in xmlNodeList) { try { XmlElement Element = (XmlElement)xn; double timestamp = Convert.ToDouble(Element.GetElementsByTagName("timestamp")[0].InnerText); network_Updates.DateTime = JavaTimeStampToDateTime(timestamp); try { network_Updates.UpdateType = Element.GetElementsByTagName("update-type")[0].InnerText; } catch { } try { network_Updates.PersonId = Element.GetElementsByTagName("id")[0].InnerText; } catch { } try { network_Updates.Description = Element.GetElementsByTagName("description")[0].InnerText; } catch { } try { network_Updates.Title = Element.GetElementsByTagName("title")[0].InnerText; } catch { } try { network_Updates.ShortenUrl = Element.GetElementsByTagName("shortened-url")[0].InnerText; } catch { } try { network_Updates.PersonFirstName = Element.GetElementsByTagName("first-name")[0].InnerText; } catch { } try { network_Updates.PersonLastName = Element.GetElementsByTagName("last-name")[0].InnerText; } catch { } try { network_Updates.PersonHeadLine = Element.GetElementsByTagName("headline")[0].InnerText; } catch { } try { network_Updates.PictureUrl = Element.GetElementsByTagName("picture-url")[0].InnerText; } catch { } try { network_Updates.url = Element.GetElementsByTagName("url")[0].InnerText; } catch { } string MessageType = Element.GetElementsByTagName("update-type")[0].InnerText; if (MessageType == "CONN") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } network_Updates.Message = network_Updates.PersonFirstName + " " + network_Updates.PersonLastName + " is now connected to " + personFirstName + " " + personLastName; } else if (MessageType == "NCON") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } network_Updates.Message = network_Updates.PersonFirstName + " " + network_Updates.PersonLastName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "CCEM") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } network_Updates.Message = network_Updates.PersonFirstName + " " + network_Updates.PersonLastName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "SHAR") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "STAT") { network_Updates.Message = Element.GetElementsByTagName("current-status")[0].InnerText; } else if (MessageType == "VIRL") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "JGRP") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "QSTN") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "ANSW") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "APPM") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "APPS") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "PRFU") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "PRFX") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "PREC") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "SVPR") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "JOBP") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "CMPY") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.url; } else if (MessageType == "MSFC") { network_Updates.Message = network_Updates.Title + " " + network_Updates.Description + "" + network_Updates.ShortenUrl; } else if (MessageType == "PICU") { network_Updates.Message = network_Updates.PersonFirstName + " " + network_Updates.PersonLastName + " Updated their profile picture"; } else if (MessageType == "PROF") { network_Updates.Message = network_Updates.PersonFirstName + " " + network_Updates.PersonLastName + " Updated their profile"; } NetworkUpdatesList.Add(network_Updates); } catch { } } return(NetworkUpdatesList); }
/// <summary> /// To retrieve updates from 1st degree connections of the authenticated user /// </summary> /// <param name="OAuth"></param> /// <param name="LinkedInId"></param> /// <param name="Count"></param> /// <returns></returns> public List <User_Updates> GetUserUpdates(oAuthLinkedIn OAuth, string LinkedInId, int Count) { User_Updates user_Updates = new User_Updates(); // SocialStream socialStream = new SocialStream(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_UserUpdates(OAuth, LinkedInId, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("update"); foreach (XmlNode xn in xmlNodeList) { try { XmlElement Element = (XmlElement)xn; double timestamp = Convert.ToDouble(Element.GetElementsByTagName("timestamp")[0].InnerText); user_Updates.DateTime = JavaTimeStampToDateTime(timestamp); try { user_Updates.UpdateType = Element.GetElementsByTagName("update-type")[0].InnerText; } catch { } try { user_Updates.PersonId = Element.GetElementsByTagName("id")[0].InnerText; } catch { } try { user_Updates.PersonFirstName = Element.GetElementsByTagName("first-name")[0].InnerText; } catch { } try { user_Updates.PersonLastName = Element.GetElementsByTagName("last-name")[0].InnerText; } catch { } try { user_Updates.PersonHeadLine = Element.GetElementsByTagName("headline")[0].InnerText; } catch { } try { user_Updates.Comment = Element.GetElementsByTagName("comment")[0].InnerText; } catch { } try { user_Updates.PictureUrl = Element.GetElementsByTagName("picture-url")[0].InnerText; } catch { } string MessageType = ""; try { MessageType = Element.GetElementsByTagName("update-type")[0].InnerText; } catch { } if (MessageType == "CONN") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " is now connected to " + personFirstName + " " + personLastName; } else if (MessageType == "NCON") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "CCEM") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "SHAR") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " " + "Updated as" + " " + user_Updates.Comment; } else if (MessageType == "STAT") { user_Updates.Message = Element.GetElementsByTagName("current-status")[0].InnerText; } else if (MessageType == "VIRL") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "JGRP") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "QSTN") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "ANSW") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "APPM") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "APPS") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PRFU") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PRFX") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PREC") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "SVPR") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "JOBP") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "CMPY") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "MSFC") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PICU") { user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " Updated their profile picture"; } else if (MessageType == "PROF") { user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + " Updated their profile"; } UserUpdatesList.Add(user_Updates); } catch { } } return(UserUpdatesList); }
public List <LinkedIn_Update_Messages> GetUserUpdateNew(oAuthLinkedIn OAuth, string LinkedInId, int Count) { List <Domain.Myfashion.Domain.LinkedIn_Update_Messages> UserUpdatesList = new List <Domain.Myfashion.Domain.LinkedIn_Update_Messages>(); // SocialStream socialStream = new SocialStream(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_UserUpdates(OAuth, LinkedInId, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("update"); foreach (XmlNode xn in xmlNodeList) { Domain.Myfashion.Domain.LinkedIn_Update_Messages user_Updates = new Domain.Myfashion.Domain.LinkedIn_Update_Messages(); try { XmlElement Element = (XmlElement)xn; double timestamp = Convert.ToDouble(Element.GetElementsByTagName("timestamp")[0].InnerText); user_Updates.CreatedDate = JavaTimeStampToDateTime(timestamp); try { user_Updates.Type = Element.GetElementsByTagName("update-type")[0].InnerText; } catch { } try { user_Updates.ProfileId = Element.GetElementsByTagName("id")[0].InnerText; } catch { } string PersonFirstName = string.Empty; string PersonLastName = string.Empty; try { PersonFirstName = Element.GetElementsByTagName("first-name")[0].InnerText; } catch { } try { PersonLastName = Element.GetElementsByTagName("last-name")[0].InnerText; } catch { } user_Updates.ProfileName = PersonFirstName + " " + PersonLastName; try { //user_Updates.PersonHeadLine = Element.GetElementsByTagName("headline")[0].InnerText; } catch { } try { user_Updates.Message = Element.GetElementsByTagName("comment")[0].InnerText; } catch { } try { user_Updates.ImageUrl = Element.GetElementsByTagName("submitted-image-url")[0].InnerText; } catch { } string MessageType = ""; try { MessageType = Element.GetElementsByTagName("update-type")[0].InnerText; } catch { } try { user_Updates.FeedId = Element.GetElementsByTagName("id")[1].InnerText; } catch { } try { user_Updates.Comments = Element.GetElementsByTagName("update-comments")[0].Attributes["total"].Value; } catch { } try { user_Updates.Likes = Element.GetElementsByTagName("num-likes")[0].InnerText; } catch { } try { user_Updates.ProfileUrl = Element.GetElementsByTagName("url")[1].InnerText; } catch { } try { user_Updates.ProfileImageUrl = Element.GetElementsByTagName("picture-url")[0].InnerText; } catch { } if (MessageType == "CONN") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.ProfileName + " is now connected to " + personFirstName + " " + personLastName; } else if (MessageType == "NCON") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.ProfileName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "CCEM") { XmlElement innerElement = (XmlElement)xn; string personFirstName = ""; string personLastName = ""; string Personheadline = ""; if (innerElement.SelectSingleNode("picture-url") == null) { personFirstName = innerElement.GetElementsByTagName("first-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { personLastName = innerElement.GetElementsByTagName("last-name")[1].InnerText; } if (innerElement.SelectSingleNode("picture-url") == null) { Personheadline = innerElement.GetElementsByTagName("headline")[1].InnerText; } user_Updates.Message = user_Updates.ProfileName + " is now connected with " + personFirstName + " " + personLastName; } else if (MessageType == "SHAR") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; user_Updates.Message = user_Updates.ProfileName + " " + "Updated as" + " " + user_Updates.Message; } else if (MessageType == "STAT") { user_Updates.Message = Element.GetElementsByTagName("current-status")[0].InnerText; } else if (MessageType == "VIRL") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "JGRP") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "QSTN") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "ANSW") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "APPM") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "APPS") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PRFU") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PRFX") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PREC") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "SVPR") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "JOBP") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "CMPY") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "MSFC") { //user_Updates.Message = user_Updates.PersonFirstName + " " + user_Updates.PersonLastName + "Updated their profile picture"; } else if (MessageType == "PICU") { user_Updates.Message = user_Updates.ProfileName + " Updated their profile picture"; } else if (MessageType == "PROF") { user_Updates.Message = user_Updates.ProfileName + " Updated their profile"; } UserUpdatesList.Add(user_Updates); } catch { } } return(UserUpdatesList); }
public List <Group_Updates> GetGroupPostData(oAuthLinkedIn OAuth, int Count, string groupid) { Group_Updates group_Updates = new Group_Updates(); ShareAndSocialStream socialStream = new ShareAndSocialStream(); xmlResult = socialStream.Get_GroupPostData(OAuth, Count, groupid); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("post"); foreach (XmlNode xn in xmlNodeList) { try { //string following = string.Empty; //string like = string.Empty; XmlElement Element = (XmlElement)xn; try { // string abbb = Element.GetElementsByTagName("creator").Item(0).InnerXml; //XmlNodeList xmlNodeList1 = Element.GetElementsByTagName("creator"); //foreach (XmlNode x in xmlNodeList1) //{ // XmlElement Elements = (XmlElement)x; // try // { // group_Updates.GpPostid = Elements.GetElementsByTagName("id")[0].InnerText; // } // catch(Exception ex) // { Console.WriteLine(ex.StackTrace); } //} group_Updates.GpPostid = Element.GetElementsByTagName("id")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.firstname = Element.GetElementsByTagName("first-name")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { string following = Element.GetElementsByTagName("is-following")[0].InnerText; if (following == "true") { group_Updates.isFollowing = 1; } else { group_Updates.isFollowing = 0; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { string like = Element.GetElementsByTagName("is-liked")[0].InnerText; if (like == "true") { group_Updates.isLiked = 1; } else { group_Updates.isLiked = 0; } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.likes_total = Element.GetElementsByTagName("likes")[0].Attributes["total"].Value; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.comments_total = Element.GetElementsByTagName("comments")[0].Attributes["total"].Value; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.summary = Element.GetElementsByTagName("summary")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.lastname = Element.GetElementsByTagName("last-name")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.headline = Element.GetElementsByTagName("headline")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } try { group_Updates.pictureurl = Element.GetElementsByTagName("picture-url")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); group_Updates.pictureurl = "../../Contents/img/blank_img.png"; } try { group_Updates.title = Element.GetElementsByTagName("title")[0].InnerText; } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } GroupUpdatesList.Add(group_Updates); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } } return(GroupUpdatesList); }