0

我正在用 java 脚本创建一个应用程序,它从 LinkedIn 获取我们需要的信息。
我的问题是......我需要LinkedIn个人资料中的公司名称,经验,城市,国家。
我会尝试,但我只能获取姓名、姓氏、行业和标题。
这是我获取上述详细信息的代码。

function loadData() {
IN.API.Profile("me")
.fields(["id", "firstName", "lastName", "pictureUrl","headline","industry"])
.params({"company-name": "Adobe", "sortCriteria" : "R", "current-company": "true"})
.result(function(result) {
  profile = result.values[0];
  profHTML = "<p><a href=\"" + profile.publicProfileUrl + "\">";
  profHTML += "<img class=img_border align=\"left\" src=\"" + profile.pictureUrl + "\"></a>";      
  profHTML += "<a href=\"" + profile.publicProfileUrl + "\">";
  profHTML += "<h2 class=myname>" + profile.firstName + " " + profile.lastName + "</a> </h2>";
  profHTML += "<span class=myheadline>" + profile.headline + "</span>";
  profHTML += "<h3>" + profile.industry + "</h3>";

  $("#profiles").html(profHTML);
});   

但我需要获取公司名称、位置和经验。我尝试了很多标签但没有成功。
请给我任何提示或指导我在哪里需要哪个标签。
提前致谢

4

2 回答 2

1

借用上面的代码,您将拥有以下内容:

function loadData() {
  IN.API.Profile("me")
    .fields(["id","firstName","lastName","pictureUrl","headline","industry","threeCurrentPositions"])
    .params({"company-name": "Adobe", "sortCriteria" : "R", "current-company": "true"})
    .result(function(result) {
      profile = result.values[0];
      positions = profile.threeCurrentPositions;

      // call to company api to get company-specific location data?
    });
}

Just parse out the returned JSON data from the threeCurrentPositions as needed to get the position data, which includes the company name and company id. The company id can be used to pull company location data from the Company API, if you need that as well.

于 2012-09-03T21:40:12.107 回答
0
       function onLinkedInLogin() {
            IN.API.Profile("me")
            .fields(["id", "firstName", "lastName", "pictureUrl", "publicProfileUrl", "industry", "location", "headline"])
            .result(function (result) {
                var firstName = result.values[0].firstName;
                var lastName = result.values[0].lastName;
                IN.parse(document.getElementById("profile"))
            })
         }
于 2014-09-05T11:56:19.627 回答