admin管理员组文章数量:1022442
Im trying to get the pany name from a specific url and ID. So, I need to get the pany someone is currently at and displaying that. Here's my code so far:
> <script type="text/javascript"> function OnLinkedInFrameworkLoad() {
> IN.Event.on(IN, "auth", OnLinkedInAuth); }
>
> function OnLinkedInAuth() {
> IN.API.Profile("me").result(ShowProfileData);
> IN.API.Raw("/people/~/picture-urls::(original)").result(highRes); }
>
> function highRes(images) {
> var img = images.values[0];
> $('#user').append('<img src="' + img + '">');
> }
>
> function ShowProfileData(profiles) {
> var member = profiles.values[0];
> var id=member.id;
> var firstName=member.firstName;
> var lastName=member.lastName;
> var imgSrc=member.pictureUrl;
> var headline=member.headline;
>
> var url = "/" + id + "/picture-url";
> console.log(member)
> console.log(url)
> console.log(pany)
> //use information captured above
>
> $("p").append("You are logged in as: ")
> $('#firstName').append(firstName);
> $('#lastName').append(lastName);
> $('#pany').append(pany);
>
> var url_2 = "/" + id + "~:(positions:(is-current,pany:(name)))";
> console.log(url_2);
> } </script>
The trouble I have is that I only get the basic member data and trying to fetch the pany name with another url but the url is not working..
Im trying to get the pany name from a specific url and ID. So, I need to get the pany someone is currently at and displaying that. Here's my code so far:
> <script type="text/javascript"> function OnLinkedInFrameworkLoad() {
> IN.Event.on(IN, "auth", OnLinkedInAuth); }
>
> function OnLinkedInAuth() {
> IN.API.Profile("me").result(ShowProfileData);
> IN.API.Raw("/people/~/picture-urls::(original)").result(highRes); }
>
> function highRes(images) {
> var img = images.values[0];
> $('#user').append('<img src="' + img + '">');
> }
>
> function ShowProfileData(profiles) {
> var member = profiles.values[0];
> var id=member.id;
> var firstName=member.firstName;
> var lastName=member.lastName;
> var imgSrc=member.pictureUrl;
> var headline=member.headline;
>
> var url = "http://api.linkedin./v1/people/" + id + "/picture-url";
> console.log(member)
> console.log(url)
> console.log(pany)
> //use information captured above
>
> $("p").append("You are logged in as: ")
> $('#firstName').append(firstName);
> $('#lastName').append(lastName);
> $('#pany').append(pany);
>
> var url_2 = "http://api.linkedin./v1/people/" + id + "~:(positions:(is-current,pany:(name)))";
> console.log(url_2);
> } </script>
The trouble I have is that I only get the basic member data and trying to fetch the pany name with another url but the url is not working..
Share Improve this question asked Sep 23, 2014 at 9:44 user2850509user28505091 Answer
Reset to default 6Ok, I solved it like this:
<script type="text/javascript">
function OnLinkedInFrameworkLoad() {
IN.Event.on(IN, "auth", OnLinkedInAuth);
// Use a larger login icon.
$('a[id*=li_ui_li_gen_]').html('<img src="images/linkButton.png" height="40" width="130" border="0" class="linkButton" />');}
function OnLinkedInAuth() {
IN.API.Profile("me").fields(["firstName","headline","positions:(is-current,pany:(name))"])
.result(function(result) {
var firstName = result.values[0].firstName;
var pany = result.values[0].positions.values[0].pany.name;
$('#firstName').append(firstName);
$('#pany').append(pany);
})
IN.API.Raw("/people/~/picture-urls::(original)").result(highRes);
}
function highRes(images) {
var img = images.values[0];
$('.linkedin').append('<img src="' + img + '" class="profile">');
$('.mobile-linkedin').append('<img src="' + img + '"class="profile">');
$("#guest").hide();
$("#hide").hide();
}
function ShowProfileData(profiles) {
var member = profiles.values[0];
var id=member.id;
var firstName=member.firstName;
var url = "http://api.linkedin./v1/people/" + id + "/picture-url";
//use information captured above
}
</script>
Im trying to get the pany name from a specific url and ID. So, I need to get the pany someone is currently at and displaying that. Here's my code so far:
> <script type="text/javascript"> function OnLinkedInFrameworkLoad() {
> IN.Event.on(IN, "auth", OnLinkedInAuth); }
>
> function OnLinkedInAuth() {
> IN.API.Profile("me").result(ShowProfileData);
> IN.API.Raw("/people/~/picture-urls::(original)").result(highRes); }
>
> function highRes(images) {
> var img = images.values[0];
> $('#user').append('<img src="' + img + '">');
> }
>
> function ShowProfileData(profiles) {
> var member = profiles.values[0];
> var id=member.id;
> var firstName=member.firstName;
> var lastName=member.lastName;
> var imgSrc=member.pictureUrl;
> var headline=member.headline;
>
> var url = "/" + id + "/picture-url";
> console.log(member)
> console.log(url)
> console.log(pany)
> //use information captured above
>
> $("p").append("You are logged in as: ")
> $('#firstName').append(firstName);
> $('#lastName').append(lastName);
> $('#pany').append(pany);
>
> var url_2 = "/" + id + "~:(positions:(is-current,pany:(name)))";
> console.log(url_2);
> } </script>
The trouble I have is that I only get the basic member data and trying to fetch the pany name with another url but the url is not working..
Im trying to get the pany name from a specific url and ID. So, I need to get the pany someone is currently at and displaying that. Here's my code so far:
> <script type="text/javascript"> function OnLinkedInFrameworkLoad() {
> IN.Event.on(IN, "auth", OnLinkedInAuth); }
>
> function OnLinkedInAuth() {
> IN.API.Profile("me").result(ShowProfileData);
> IN.API.Raw("/people/~/picture-urls::(original)").result(highRes); }
>
> function highRes(images) {
> var img = images.values[0];
> $('#user').append('<img src="' + img + '">');
> }
>
> function ShowProfileData(profiles) {
> var member = profiles.values[0];
> var id=member.id;
> var firstName=member.firstName;
> var lastName=member.lastName;
> var imgSrc=member.pictureUrl;
> var headline=member.headline;
>
> var url = "http://api.linkedin./v1/people/" + id + "/picture-url";
> console.log(member)
> console.log(url)
> console.log(pany)
> //use information captured above
>
> $("p").append("You are logged in as: ")
> $('#firstName').append(firstName);
> $('#lastName').append(lastName);
> $('#pany').append(pany);
>
> var url_2 = "http://api.linkedin./v1/people/" + id + "~:(positions:(is-current,pany:(name)))";
> console.log(url_2);
> } </script>
The trouble I have is that I only get the basic member data and trying to fetch the pany name with another url but the url is not working..
Share Improve this question asked Sep 23, 2014 at 9:44 user2850509user28505091 Answer
Reset to default 6Ok, I solved it like this:
<script type="text/javascript">
function OnLinkedInFrameworkLoad() {
IN.Event.on(IN, "auth", OnLinkedInAuth);
// Use a larger login icon.
$('a[id*=li_ui_li_gen_]').html('<img src="images/linkButton.png" height="40" width="130" border="0" class="linkButton" />');}
function OnLinkedInAuth() {
IN.API.Profile("me").fields(["firstName","headline","positions:(is-current,pany:(name))"])
.result(function(result) {
var firstName = result.values[0].firstName;
var pany = result.values[0].positions.values[0].pany.name;
$('#firstName').append(firstName);
$('#pany').append(pany);
})
IN.API.Raw("/people/~/picture-urls::(original)").result(highRes);
}
function highRes(images) {
var img = images.values[0];
$('.linkedin').append('<img src="' + img + '" class="profile">');
$('.mobile-linkedin').append('<img src="' + img + '"class="profile">');
$("#guest").hide();
$("#hide").hide();
}
function ShowProfileData(profiles) {
var member = profiles.values[0];
var id=member.id;
var firstName=member.firstName;
var url = "http://api.linkedin./v1/people/" + id + "/picture-url";
//use information captured above
}
</script>
本文标签: javascriptGet company name from Linkedin apiStack Overflow
版权声明:本文标题:javascript - Get company name from Linkedin api - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745573114a2156856.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论