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;
 }
Beispiel #2
0
 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;
 }
        //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;
        }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 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 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;
   }
Beispiel #7
0
        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;

        }
Beispiel #8
0
        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;
        }
Beispiel #9
0
         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;
         }
Beispiel #10
0
         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 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;
 }
Beispiel #12
0
         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;
         }
Beispiel #13
0
 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;
 }
Beispiel #14
0
 /// <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;
 }
Beispiel #15
0
        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;

        }
Beispiel #16
0
 public string GetLinkedIn_UserProfile(oAuthLinkedIn OAuth)
 {
     string response = OAuth.APIWebRequest("GET", Global.GetUserProfileUrl, null);
     return response;
 }
Beispiel #17
0
 /// <summary>
 /// Displays the profile the requestor is allowed to see.
 /// </summary>
 /// <param name="OAuth"></param>
 /// <returns></returns>
 public XmlDocument Get_UserProfile(oAuthLinkedIn OAuth)
 {
     string response = OAuth.APIWebRequest("GET", Global.GetUserProfileUrl, null);
     xmlResult.Load(new StringReader(response));
     return xmlResult;
 }
Beispiel #18
0
 /// <summary>
 /// The Job Search API enables search across LinkedIn's job postings Keyword Wise.
 /// </summary>
 /// <param name="OAuth"></param>
 /// <param name="keyword"></param>
 /// <param name="Count"></param>
 /// <returns></returns>
 public XmlDocument Get_JobSearchKeyword(oAuthLinkedIn OAuth, string keyword, int Count)
 {
     string response = OAuth.APIWebRequest("GET", Global.GetJobSearchKeyword + keyword + "&count=" + Count, null);
     xmlResult.Load(new StringReader(response));
     return xmlResult;
 }
Beispiel #19
0
        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;

        }
Beispiel #20
0
 public string GetLinkedIN_CompanyUpdateById(oAuthLinkedIn OAuth, string CoampanyPageId)
 {
     string url = "https://api.linkedin.com/v1/companies/" + CoampanyPageId + "/updates?format=json";
     string response = OAuth.APIWebRequest("GET", url, null);
     return response;
 }
        public string LinkedinCompanyrecentActivites(string CompanyId)
        {
            string response = string.Empty;
            try
            {
                //ArrayList alstLIAccounts = objLinkedinrepo.getAllLinkedinAccounts();
                //Domain.Socioboard.Domain.LinkedInAccount linkacc = (Domain.Socioboard.Domain.LinkedInAccount)alstLIAccounts[0];
                oAuthLinkedIn oauth = new oAuthLinkedIn();
                oauth.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"];
                oauth.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"];
                //oauth.Token = "49c2202b-2cd4-4c74-b5db-ce8d7f5e029e";
                //oauth.TokenSecret = "a79cfbe5-d268-456e-8fdc-0d12869a1cf3";
                //oauth.Verifier = "52921";
                oauth.Token = "b82db6bb-21bb-44d2-a298-0b093708ddbf";
                oauth.TokenSecret = "f7c9b7b8-9295-46fe-8cb4-914c1c52820f";
                oauth.Verifier = "23836";
                //oauth.AccessTokenGet(linkacc.OAuthToken);
                //TODO: access Token Logic
                oauth.AccessTokenGet("b82db6bb-21bb-44d2-a298-0b093708ddbf");

                //https://api.linkedin.com/v1/people-search? keywords=[space delimited keywords]
                //oauth.AccessTokenGet(oauth.Token);
                // company.Get_CompanyProfileById(oauth, keyword);
                //string response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/companies/" + keyword + ":(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)", null);
                response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/companies/" + CompanyId + "/updates?start=0&count=200&event-type=status-update", null);
            }
            catch (Exception e) { }
            return response;

        }
        public string LinkedinSearch(string keyword)
        {
            string profileid = string.Empty;
            try
            {
                // ArrayList alstLIAccounts = objLinkedinrepo.getAllLinkedinAccounts();
                //Domain.Socioboard.Domain.LinkedInAccount linkacc = (Domain.Socioboard.Domain.LinkedInAccount)alstLIAccounts[0];
                oAuthLinkedIn oauth = new oAuthLinkedIn();
                oauth.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"];
                oauth.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"];
                //oauth.Token = "49c2202b-2cd4-4c74-b5db-ce8d7f5e029e";
                //oauth.TokenSecret = "a79cfbe5-d268-456e-8fdc-0d12869a1cf3";
                //oauth.Verifier = "52921";
                oauth.Token = "b82db6bb-21bb-44d2-a298-0b093708ddbf";
                oauth.TokenSecret = "f7c9b7b8-9295-46fe-8cb4-914c1c52820f";
                oauth.Verifier = "23836";
                //oauth.AccessTokenGet(linkacc.OAuthToken);
                //TODO: access Token Logic
                oauth.AccessTokenGet("b82db6bb-21bb-44d2-a298-0b093708ddbf");
                //oauth.AccessTokenGet();

                //https://api.linkedin.com/v1/people-search? keywords=[space delimited keywords]
                //oauth.AccessTokenGet(oauth.Token);
                // company.Get_CompanyProfileById(oauth, keyword);
                //string response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/companies/" + keyword + ":(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)", null);
                string response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/company-search" + ":(companies:(id,name,universal-name,website-url,industries,status,logo-url,blog-rss-url,twitter-id,employee-count-range,specialties,locations,description,stock-exchange,founded-year,end-year,num-followers))?keywords=" + keyword, null);
                XmlDocument XmlResult = new XmlDocument();
                XmlResult.Load(new StringReader(response));


                XmlNode ResultCompany = null;
                int followers = 0;
                string result = string.Empty;
                XmlNodeList Companies = XmlResult.SelectNodes("company-search/companies/company");
                foreach (XmlNode node in Companies)
                {
                    if (Convert.ToInt32(node.SelectSingleNode("num-followers").InnerText) > followers)
                    {
                        ResultCompany = node;
                        followers = Convert.ToInt32(node.SelectSingleNode("num-followers").InnerText);
                    }

                }



                return response;

            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.StackTrace);
                return new JavaScriptSerializer().Serialize("Please try Again");
            }
        }
 public string GetLinkedIn_UserUpdates(oAuthLinkedIn OAuth, string LinkedInId, int Count)
 {
     string url = "https://api.linkedin.com/v1/people/id=" + LinkedInId + "/network/updates?scope=self" + "&count=" + Count + "?format=json";
     string response = OAuth.APIWebRequest("GET", url, null);
     return response;
 }
Beispiel #24
0
 public string GetLinkedINCommentOnPagePost(oAuthLinkedIn oauth, string Updatekey,string PageId)
 {
     string url = "https://api.linkedin.com/v1/companies/" + PageId + "/updates/key=" + Updatekey +"?format=json";
     string response = oauth.APIWebRequest("GET", url, null);
     return response;
 }
Beispiel #25
0
        public string SetLikeUpdateOnPagePost(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/people/~/network/updates/key=" + postid + "/is-liked";

            string response = OAuth.APIWebRequest("PUT", url, xml);
            return response;
        }
Beispiel #26
0
 public string GetLinkedIn_Get_People_Connection(oAuthLinkedIn OAuth)
 {
     string response = OAuth.APIWebRequest("GET", Global.GetPeopleConnectionUrl, null);
     return response;
 }
        public string LinkedinCompnayJobs(string CompanyId)
        {
            string response = string.Empty;
            try
            {
                //ArrayList alstLIAccounts = objLinkedinrepo.getAllLinkedinAccounts();
                //Domain.Socioboard.Domain.LinkedInAccount linkacc = (Domain.Socioboard.Domain.LinkedInAccount)alstLIAccounts[0];
                oAuthLinkedIn oauth = new oAuthLinkedIn();
                oauth.ConsumerKey = ConfigurationManager.AppSettings["LiApiKey"];
                oauth.ConsumerSecret = ConfigurationManager.AppSettings["LiSecretKey"];
                oauth.Token = "49c2202b-2cd4-4c74-b5db-ce8d7f5e029e";
                oauth.TokenSecret = "a79cfbe5-d268-456e-8fdc-0d12869a1cf3";
                oauth.Verifier = "52921";
                //oauth.AccessTokenGet(linkacc.OAuthToken);
                oauth.AccessTokenGet("fd200850-37b4-4845-9671-13e5280c7535");
                //TODO : access Token Logic
                //oauth.AccessTokenGet();

                //https://api.linkedin.com/v1/people-search? keywords=[space delimited keywords]
                //oauth.AccessTokenGet(oauth.Token);
                // company.Get_CompanyProfileById(oauth, keyword);
                //string response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/companies/" + keyword + ":(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)", null);
                response = oauth.APIWebRequest("GET", "https://api.linkedin.com/v1/jobs/" + CompanyId, null);
            }
            catch (Exception e) { }
            return response;

        }
 /// <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 XmlDocument Get_UserUpdates(oAuthLinkedIn OAuth, string LinkedInId, int Count)
 {
     string response = OAuth.APIWebRequest("GET", Global.GetNetworkUserUpdates + LinkedInId + "/network/updates?scope=self" + "&count=" + Count, null);
     xmlResult.Load(new StringReader(response));
     return xmlResult;
 }
        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);
        }
Beispiel #30
0
 public string GetLinkedIN_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)?format=json";
     string response = OAuth.APIWebRequest("GET",url,null);
     return response;
 }