public XmlDocument GetCommentOnPagePost(oAuthLinkedIn oauth, string Updatekey) { string url = "https://api.linkedin.com/v1/people/~/network/updates/key=" + Updatekey + "/update-comments/"; string response = oauth.APIWebRequest("GET", url, null); XmlResult.Load(new StringReader(response)); return XmlResult; }
/// <summary> /// The Job Search API enables search across LinkedIn's job postings Title Wise. /// </summary> /// <param name="OAuth"></param> /// <param name="Title"></param> /// <param name="Count"></param> /// <returns></returns> public List<Jobdetail> GetJobSearchTitle(oAuthLinkedIn OAuth, string Title, int Count) { Jobdetail job_result = new Jobdetail(); Jobs jobsearch = new Jobs(); xmlResult = jobsearch.Get_JobSearchTitle(OAuth, Title, Count); XmlNodeList xmlNodeList = xmlResult.GetElementsByTagName("job"); foreach (XmlNode xn in xmlNodeList) { XmlElement Element = (XmlElement)xn; try { job_result.Company = Element.GetElementsByTagName("name")[0].InnerText; } catch { } try { job_result.Headline = Element.GetElementsByTagName("headline")[0].InnerText; } catch { } try { job_result.FirstName = Element.GetElementsByTagName("first-name")[0].InnerText; } catch { } try { job_result.LastName = Element.GetElementsByTagName("last-name")[0].InnerText; } catch { } try { job_result.Description = Element.GetElementsByTagName("description-snippet")[0].InnerText; } catch { } try { job_result.Location = Element.GetElementsByTagName("location-description")[0].InnerText; } catch { } JobDetailList.Add(job_result); } return JobDetailList; }
public XmlDocument Get_GroupUpdates(oAuthLinkedIn OAuth, int Count) { string response = OAuth.APIWebRequest("GET", Global.GetGroupUpdates, null); if (response != "") xmlResult.Load(new StringReader(response)); return xmlResult; }
//public XmlDocument Get_GroupFollowPost(oAuthLinkedIn OAuth,string gppostid) //{ // string posturl = "https://api.linkedin.com/v1/posts/" + gppostid + "/relation-to-viewer/is-following"; // string response = OAuth.APIWebRequest("PUT", posturl, null); // if (response != "") // xmlResult.Load(new StringReader(response)); // return xmlResult; //} /// <summary> /// /// </summary> /// <param name="OAuth"></param> /// <param name="msg"></param> /// <returns></returns> public string SetStatusUpdate(oAuthLinkedIn OAuth, string msg) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xml += "<current-status>" + msg + "</current-status>"; string response = OAuth.APIWebRequest("PUT", Global.StatusUpdate, xml); return response; }
public void GetUserProfile(oAuthLinkedIn OAuth, string LinkedinUserId, Guid user) { LinkedInProfile objLinkedInProfile = new LinkedInProfile(); LinkedInProfile.UserProfile objUserProfile = new LinkedInProfile.UserProfile(); objUserProfile = objLinkedInProfile.GetUserProfile(OAuth); GetLinkedInUserProfile(objUserProfile, OAuth, user, LinkedinUserId); }
public XmlDocument Get_CompanyUpdateById(oAuthLinkedIn OAuth, string CoampanyPageId) { string url = "https://api.linkedin.com/v1/companies/" + CoampanyPageId + "/updates"; string response = OAuth.APIWebRequest("GET", url, null); XmlResult.Load(new StringReader(response)); return XmlResult; }
public XmlDocument GetLikeorNotOnPagePost(oAuthLinkedIn oauth, string Updatekey, string PageId) { string url = "https://api.linkedin.com/v1/companies/" + PageId + "/updates/key=" + Updatekey + "/is-liked/"; //string url = "https://api.linkedin.com/v1/people/~/network/updates/key=" + Updatekey + "/is-liked/"; string response = oauth.APIWebRequest("GET", url, null); XmlResult.Load(new StringReader(response)); return XmlResult; }
public void linkedincompanypagetest() { oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); string authLink = Linkedin_oauth.AuthorizationLinkGet(); Session["reuqestToken"] = Linkedin_oauth.Token; Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret; Response.Redirect(authLink); }
public string SetCommentOnPagePost(oAuthLinkedIn oauth, string PageId, string Updatekey, string comment) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xml += " <update-comment><comment>" + comment + "</comment></update-comment>"; string url = "https://api.linkedin.com/v1/companies/" + PageId + "/updates/key=" + Updatekey + "/update-comments-as-company/"; string response = oauth.APIWebRequest("POST", url, xml); return response; }
public XmlDocument Get_GroupPostData(oAuthLinkedIn OAuth, int Count,string groupid) { string posturl = "https://api.linkedin.com/v1/groups/" + groupid + "/posts:(creation-timestamp,id,title,summary,creator:(first-name,last-name,picture-url,headline,id),likes,comments,attachment:(image-url,content-domain,content-url,title,summary),relation-to-viewer)?category=discussion&order=recency&count=50"; string response = OAuth.APIWebRequest("GET", posturl, null); if (response != "") xmlResult.Load(new StringReader(response)); return xmlResult; }
public void AuthenticateLinkedin(object sender, EventArgs e) { oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); string authLink = Linkedin_oauth.AuthorizationLinkGet(); Session["reuqestToken"] = Linkedin_oauth.Token; Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret; Response.Redirect(authLink); }
public string SetLikeUpdate(oAuthLinkedIn OAuth, string postid, string msg) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xml += " <is-liked>" + msg + "</is-liked>"; string url = "https://api.linkedin.com/v1/posts/" + postid + "/relation-to-viewer/is-liked"; string response = OAuth.APIWebRequest("PUT", url, xml); return response; }
public string SetCommentOnPost(oAuthLinkedIn OAuth, string postid, string msg) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xml += "<comment><text>" + msg + "</text></comment>"; string url = "https://api.linkedin.com/v1/posts/" + postid + "/comments"; string response = OAuth.APIWebRequest("POST", url, xml); return response; }
public XmlDocument Get_CompanyProfileById(oAuthLinkedIn OAuth, string CoampanyPageId) { //string url = "https://api.linkedin.com/v1/companies/" + CoampanyPageId + ":(id,name,email-domains,description,founded-year,end-year,locations,Specialties,website-url,status,employee-count-range,industries,company-type,logo-url,square-logo-url,blog-rss-url,num-followers,universal-name,locations:(description),locations:(is-headquarters),locations:(is-active),locations:(address),locations:(address:(street1)),locations:(address:(street2)),locations:(address:(city)),locations:(address:(state)),locations:(address:(postal-code)),locations:(address:(country-code)),locations:(address:(region-code)),locations:(contact-info),locations:(contact-info:(phone1)),locations:(contact-info:(phone2)),locations:(contact-info:(fax)))"; string url = "https://api.linkedin.com/v1/companies/" + CoampanyPageId + ":(id,name,email-domains,description,founded-year,end-year,locations,Specialties,website-url,status,employee-count-range,industries,company-type,logo-url,square-logo-url,blog-rss-url,num-followers,universal-name)"; string response = OAuth.APIWebRequest("GET", url, null); XmlResult.Load(new StringReader(response)); return XmlResult; }
/// <summary> /// The People Search API returns information about people. /// </summary> /// <param name="OAuth"></param> /// <param name="keyword"></param> /// <returns></returns> public XmlDocument Get_People_Search(oAuthLinkedIn OAuth, string keyword) { string response = string.Empty; try { response = OAuth.APIWebRequest("GET", Global.GetPeopleSearchUrl + keyword + "sort=distance", null); } catch { } xmlResult.Load(new StringReader(response)); return xmlResult; }
public XmlDocument SearchPeople(oAuthLinkedIn OAuth,string keyword) { string response = string.Empty; try { response = OAuth.APIWebRequest("GET", "http://api.linkedin.com/v1/people-search?keyword="+keyword+"sort=distance", null); } catch { } xmlResult.Load(new StringReader(response)); return xmlResult; }
public string SetPostUpdate(oAuthLinkedIn OAuth,string groupId, string msg,string title) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; // xml += "<current-status>" + msg + "</current-status>"; xml += "<post><title>" + title + "</title><summary>" + msg + "</summary></post>"; string url = "http://api.linkedin.com/v1/groups/" + groupId + "/posts"; string response = OAuth.APIWebRequest("POST",url, xml); return response; }
public string SetStatusUpdate(oAuthLinkedIn OAuth, string msg) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //xml += "<current-status>" + msg + "</current-status>"; //string response = OAuth.APIWebRequest("PUT", Global.StatusUpdate, xml); xml+= "<share>"; xml += "<comment>" + msg + "</comment><visibility><code>anyone</code></visibility></share>"; string response = OAuth.APIWebRequest("POST", "https://api.linkedin.com/v1/people/~/shares", xml); return response; }
public XmlDocument Get_People_Connection(oAuthLinkedIn OAuth) { string response = string.Empty; try { response = OAuth.APIWebRequest("GET", Global.GetPeopleConnectionUrl, null); } catch { } xmlResult.Load(new StringReader(response)); return xmlResult; }
public string SetPostOnPageWithImage(oAuthLinkedIn oauth, string PageId, string imageurl, string post) { string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; xml += " <share><visibility><code>anyone</code></visibility><comment>" + post + "</comment>"; //xml += "<content><submitted-url>http://socioboard.com/</submitted-url><title>none</title> <submitted-image-url>" + imageurl + "</submitted-image-url></content></share>"; xml += "<content><submitted-url>http://localhost:5334/</submitted-url><title>none</title> <submitted-image-url>" + imageurl + "</submitted-image-url></content></share>"; string url = "https://api.linkedin.com/v1/companies/" + PageId + "/shares"; string response = oauth.APIWebRequest("POST", url, xml); return response; }
public override void PostScheduleMessage(dynamic data) { try { LinkedInAccountRepository linkedinrepo = new LinkedInAccountRepository(); LinkedInAccount linkedinaccount = linkedinrepo.getLinkedinAccountDetailsById(data.ProfileId); Console.WriteLine("========================================================================="); // IEnumerable<LinkedInAccount> lstlinkedinaccount = linkedinrepo.getLinkedinAccountDetailsById(data.ProfileId); //foreach (LinkedInAccount item in lstlinkedinaccount) //{ // linkedinaccount = item; // break; //} oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["LiApiKey"].ToString(); Linkedin_oauth.ConsumerSecret = System.Configuration.ConfigurationSettings.AppSettings["LiSecretKey"].ToString(); Linkedin_oauth.FirstName = linkedinaccount.LinkedinUserName; Linkedin_oauth.Token = linkedinaccount.OAuthToken; Linkedin_oauth.TokenSecret = linkedinaccount.OAuthSecret; Linkedin_oauth.Verifier = linkedinaccount.OAuthVerifier; LinkedInUser linkeduser = new LinkedInUser(); var response = linkeduser.SetStatusUpdate(Linkedin_oauth, data.ShareMessage); Console.WriteLine("Message post on linkedin for Id :" + linkedinaccount.LinkedinUserId + " and Message: " + data.ShareMessage); Console.WriteLine("============================================================="); ScheduledMessageRepository schrepo = new ScheduledMessageRepository(); ScheduledMessage schmsg = new ScheduledMessage(); schmsg.Id = data.Id; schmsg.ProfileId = data.ProfileId; schmsg.ProfileType = "linkedin"; schmsg.Status = true; schmsg.UserId = data.UserId; schmsg.ShareMessage = data.ShareMessage; schmsg.ScheduleTime = data.ScheduleTime; schmsg.ClientTime = data.ClientTime; schmsg.CreateTime = data.CreateTime; schmsg.PicUrl = data.PicUrl; schrepo.updateMessage(data.Id); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }
public string GetLinkedinRedirectUrl(string consumerKey, string consumerSecret) { logger.Error("GetLinkedinRedirectUrl()"); System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls; string authLink = string.Empty; oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.ConsumerKey = consumerKey; Linkedin_oauth.ConsumerSecret = consumerSecret; authLink = Linkedin_oauth.AuthorizationLinkGet() + "~" + Linkedin_oauth.Token + "~" + Linkedin_oauth.TokenSecret; //Session["reuqestToken"] = Linkedin_oauth.Token; //Session["reuqestTokenSecret"] = Linkedin_oauth.TokenSecret; return authLink; }
public void GetLinkedIndata(object UserId) { Guid userId = (Guid)UserId; LinkedInHelper objliHelper = new LinkedInHelper(); LinkedInAccountRepository objLiRepo = new LinkedInAccountRepository(); oAuthLinkedIn _oauth = new oAuthLinkedIn(); ArrayList arrLiAccount = objLiRepo.getAllLinkedinAccountsOfUser(userId); foreach (LinkedInAccount itemLi in arrLiAccount) { _oauth.Token = itemLi.OAuthToken; _oauth.TokenSecret = itemLi.OAuthSecret; _oauth.Verifier = itemLi.OAuthVerifier; objliHelper.GetLinkedInFeeds(_oauth, itemLi.LinkedinUserId, userId); } }
public string SetPostOnPage(oAuthLinkedIn oauth, string PageId, string post) { //string response1 = oauth.APIWebRequest("GET", GlobusLinkedinLib.App.Core.Global.GetCompanyUrl, null); //XmlDocument xmlCompany = new XmlDocument(); //xmlCompany.Load(new StringReader(response1)); //string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //xml += "<share><visibility><code>anyone</code></visibility><comment>"+post+"</comment></share>"; string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><share><visibility><code>anyone</code></visibility><comment>" + post + "</comment></share>"; string url = "https://api.linkedin.com/v1/companies/" + PageId + "/shares"; string response = oauth.APIWebRequest("POST", url, xml); return response; }
public List<Domain.Myfashion.Domain.LinkedInGroup.Group_Updates> GetGroupUpdates(oAuthLinkedIn OAuth, int Count) { Domain.Myfashion.Domain.LinkedInGroup.Group_Updates group_Updates = new Domain.Myfashion.Domain.LinkedInGroup.Group_Updates(); List<Domain.Myfashion.Domain.LinkedInGroup.Group_Updates> GroupUpdatesList = new List<Domain.Myfashion.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 void GetLinkedInFeeds(oAuthLinkedIn _oauth,string profileId,Guid userId) { LinkedInNetwork objln = new LinkedInNetwork(); LinkedInFeedRepository objliFeedsRepo = new LinkedInFeedRepository(); List<LinkedInNetwork.Network_Updates> userUPdate = objln.GetNetworkUpdates(_oauth, 20); LinkedInFeed lnkfeeds=new LinkedInFeed(); foreach (var item in userUPdate) { lnkfeeds.Feeds = item.Message; lnkfeeds.FromId = item.PersonId; lnkfeeds.FromName = item.PersonFirstName + " " + item.PersonLastName; lnkfeeds.FeedsDate =Convert.ToDateTime(item.DateTime); lnkfeeds.EntryDate = DateTime.Now; lnkfeeds.ProfileId = profileId; lnkfeeds.Type = item.UpdateType; lnkfeeds.UserId = userId; lnkfeeds.FromPicUrl = item.PictureUrl; objliFeedsRepo.addLinkedInFeed(lnkfeeds); } }
public override void PostScheduleMessage(dynamic data) { try { LinkedInAccountRepository linkedinrepo = new LinkedInAccountRepository(); LinkedInAccount linkedinaccount = linkedinrepo.getUserInformation(data.UserId, data.ProfileId); oAuthLinkedIn Linkedin_oauth = new oAuthLinkedIn(); Linkedin_oauth.ConsumerKey = System.Configuration.ConfigurationSettings.AppSettings["LiApiKey"]; Linkedin_oauth.ConsumerSecret = System.Configuration.ConfigurationSettings.AppSettings["LiSecretKey"]; Linkedin_oauth.FirstName = linkedinaccount.LinkedinUserName; Linkedin_oauth.Token = linkedinaccount.OAuthToken; Linkedin_oauth.TokenSecret = linkedinaccount.OAuthSecret; Linkedin_oauth.Verifier = linkedinaccount.OAuthVerifier; LinkedInUser linkeduser = new LinkedInUser(); var response = linkeduser.SetStatusUpdate(Linkedin_oauth, data.ShareMessage); Console.WriteLine("Message post on linkedin for Id :" + linkedinaccount.LinkedinUserId + " and Message: " + data.ShareMessage); ScheduledMessageRepository schrepo = new ScheduledMessageRepository(); schrepo.updateMessage(data.Id); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); } }
public string SetStatusUpdate(oAuthLinkedIn OAuth, string message) { ShareAndSocialStream socialStream = new ShareAndSocialStream(); string responce = socialStream.SetStatusUpdate(OAuth, message); return responce; }
/// <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<Domain.Socioboard.Domain.LinkedInUser.User_Updates> GetUserUpdates(oAuthLinkedIn OAuth, string LinkedInId, int Count) { Domain.Socioboard.Domain.LinkedInUser.User_Updates user_Updates = new Domain.Socioboard.Domain.LinkedInUser.User_Updates(); List<Domain.Socioboard.Domain.LinkedInUser.User_Updates> UserUpdatesList = new List<Domain.Socioboard.Domain.LinkedInUser.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 string GetLinkedinCompanyPage(string oauth_token, string oauth_verifier, string reuqestTokenSecret, string consumerKey, string consumerSecret, string UserId, string GroupId) { List<Helper.AddlinkedinCompanyPage> lstAddLinkedinPage = new List<Helper.AddlinkedinCompanyPage>(); string ret = string.Empty; oAuthLinkedIn _oauth = new oAuthLinkedIn(); try { _oauth.ConsumerKey = consumerKey; } catch (Exception ex) { Console.WriteLine(ex.Message); } try { _oauth.ConsumerSecret = consumerSecret; } catch (Exception ex) { Console.WriteLine(ex.Message); } try { _oauth.Token = oauth_token; } catch (Exception ex) { Console.WriteLine(ex.Message); } try { _oauth.TokenSecret = reuqestTokenSecret; } catch (Exception ex) { Console.WriteLine(ex.Message); } try { _oauth.Verifier = oauth_verifier; } catch (Exception ex) { Console.WriteLine(ex.Message); } try { _oauth.AccessTokenGet(oauth_token); } catch (Exception ex) { Console.WriteLine(ex.Message); } XmlDocument xmlResult = new XmlDocument(); XmlDocument xmlCompany = new XmlDocument(); GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People peopleConnection = new GlobusLinkedinLib.LinkedIn.Core.PeopleMethods.People(); xmlResult = peopleConnection.Get_UserProfile(_oauth); string UserProfileId = xmlResult.GetElementsByTagName("id")[0].InnerText; string response = _oauth.APIWebRequest("GET", GlobusLinkedinLib.App.Core.Global.GetCompanyUrl, null); string strLidPageDiv = string.Empty; xmlCompany.Load(new StringReader(response)); string cnt = string.Empty; XmlElement root = xmlCompany.DocumentElement; if (root.HasAttribute("total")) { cnt = root.GetAttribute("total"); } int total = Convert.ToInt16(cnt); if (total != 0) { for (int i = 0; i < total; i++) { Helper.AddlinkedinCompanyPage objAddLinkedinPage = new Helper.AddlinkedinCompanyPage(); objAddLinkedinPage.PageId = xmlCompany.GetElementsByTagName("id")[i].InnerText; objAddLinkedinPage.PageName = xmlCompany.GetElementsByTagName("name")[i].InnerText; objAddLinkedinPage._Oauth = _oauth; lstAddLinkedinPage.Add(objAddLinkedinPage); } } return new JavaScriptSerializer().Serialize(lstAddLinkedinPage); }