本文整理汇总了C#中GlobusLinkedinLib.Authentication.oAuthLinkedIn.AccessTokenGet方法的典型用法代码示例。如果您正苦于以下问题:C# oAuthLinkedIn.AccessTokenGet方法的具体用法?C# oAuthLinkedIn.AccessTokenGet怎么用?C# oAuthLinkedIn.AccessTokenGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobusLinkedinLib.Authentication.oAuthLinkedIn
的用法示例。
在下文中一共展示了oAuthLinkedIn.AccessTokenGet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLinkedinCompanyPage
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);
}
示例2: AddLinkedinAccount
public string AddLinkedinAccount(string oauth_token, string oauth_verifier, string reuqestTokenSecret, string consumerKey, string consumerSecret, string UserId, string GroupId)
{
try
{
logger.Error("AddLinkedinAccount()");
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls;
string ret = string.Empty;
LinkedInProfile objProfile = new LinkedInProfile();
LinkedInProfile.UserProfile objUserProfile = new LinkedInProfile.UserProfile();
objSocialProfile = new Domain.Socioboard.Domain.SocialProfile();
oAuthLinkedIn _oauth = new oAuthLinkedIn();
objLinkedInAccount = new LinkedInAccount();
#region Get linkedin Profile data from Api
try
{
_oauth.ConsumerKey = consumerKey;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
_oauth.ConsumerSecret = consumerSecret;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
_oauth.Token = oauth_token;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
_oauth.TokenSecret = reuqestTokenSecret;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
_oauth.Verifier = oauth_verifier;
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
_oauth.AccessTokenGet(oauth_token);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
try
{
objUserProfile = objProfile.GetUserProfile(_oauth);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
logger.Error(ex.Message);
}
#endregion
dynamic data = objUserProfile;
try
{
#region LinkedInAccount
objLinkedInAccount.UserId = Guid.Parse(UserId);
objLinkedInAccount.LinkedinUserId = data.id.ToString();
try
{
objLinkedInAccount.EmailId = data.email.ToString();
}
catch (Exception ex)
{
logger.Error(ex.StackTrace);
}
objLinkedInAccount.LinkedinUserName = data.first_name.ToString() + data.last_name.ToString();
objLinkedInAccount.OAuthToken = _oauth.Token;
objLinkedInAccount.OAuthSecret = _oauth.TokenSecret;
objLinkedInAccount.OAuthVerifier = _oauth.Verifier;
try
{
//.........这里部分代码省略.........
示例3: LinkedinCompnayJobs
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;
}
示例4: LinkedinCompanyrecentActivites
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;
}
示例5: LinkedinSearch
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");
}
}
示例6: LinkedinCompnayJobs
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 = "Token";
oauth.TokenSecret = "Your Token Secret";
oauth.Verifier = "Your verifier";
oauth.AccessTokenGet(linkacc.OAuthToken);
//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;
}