如何从linkedin jsapi获取公司ID [英] how to get companies id from linkedin jsapi

查看:180
本文介绍了如何从linkedin jsapi获取公司ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用jsapi从以下网址获取公司ID,iam使用以下网址

i was trying to get companies id from linkedin using jsapi,iam using below url

"/company-search:(companies:(id,name))?keywords = ibm%20oracle%20infosys"

"/company-search:(companies:(id,name))?keywords=ibm%20oracle%20infosys"

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

i got ids of some other companies

{"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

how to get companies id for more than one comapny at a time

推荐答案

为此使用JSON.stringify和一个正则表达式:

Use JSON.stringify plus a regexp for this:

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"] 
*/

这篇关于如何从linkedin jsapi获取公司ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆