如何从LinkedIn JSAPI公司ID(how to get companies id from

2019-07-20 14:46发布

我试图使用JSAPI LinkedIn获得公司ID,通过以下网址IAM

“/公司搜索:(公司:(ID,姓名))?关键字= IBM%20oracle%20infosys”

我得到了一些其他公司的IDS

{"companies": {
"_count": 10,
"_start": 0,
"_total": 1079,
"values": [
{
  "id": 6005,
  "name": "Sonata Software"
},
{
  "id": 5983,
  "name": "QLogic"
},
{
  "id": 39626,
  "name": "Prosoft Technology Group"
},
{
  "id": 6290,
  "name": "BCC"
},
{
  "id": 23367,
  "name": "Goldstone Technologies"
},
{
  "id": 36655,
  "name": "SoftwareONE"
},
{
  "id": 10951,
  "name": "Sirius Computer Solutions"
},
{
  "id": 10046,
  "name": "ITWorx"
},
{
  "id": 7833,
  "name": "SYSTIME"
},
{
  "id": 57561,
  "name": "ZSL Inc"
}
]
}}

如何获得一个以上的公司北美经销商ID在同一时间

Answer 1:

使用JSON.stringify加上这样的正则表达式:

JSON.stringify({"companies": {
"_count": 10,
"_start": 0,
"_total": 1079,
"values": [
{
  "id": 6005,
  "name": "Sonata Software"
},
{
  "id": 5983,
  "name": "QLogic"
},
{
  "id": 39626,
  "name": "Prosoft Technology Group"
},
{
  "id": 6290,
  "name": "BCC"
},
{
  "id": 23367,
  "name": "Goldstone Technologies"
},
{
  "id": 36655,
  "name": "SoftwareONE"
},
{
  "id": 10951,
  "name": "Sirius Computer Solutions"
},
{
  "id": 10046,
  "name": "ITWorx"
},
{
  "id": 7833,
  "name": "SYSTIME"
},
{
  "id": 57561,
  "name": "ZSL Inc"
}
]
}}).match(/id..\d+/g) 

/* Returns:
["id":6005", "id":5983", "id":39626", "id":6290", "id":23367", "id":36655", "id":10951", "id":10046", "id":7833", "id":57561"] 
*/


文章来源: how to get companies id from linkedin jsapi