可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have the Linkedin company URL as follows,
http://in.linkedin.com/company/abb
and the company ID for ABB limited is 277579
. Essentially you can also reach ABB through http://www.linkedin.com/company/277579
.
But if I have only http://in.linkedin.com/company/abb
. Is it possible to get the company ID through this URL? Does parsing the URL help? Seeking any good method to get the company ID.
Is there any other way to do without using Linkedin API?
Hope I am clear with my question. Any help would be appreciated.
回答1:
Type in your company name in the autocomplete field. Wait until your company name appears as a result. Then click on your company name. Click on Get Code.
<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script> <script type="IN/FollowCompany" data-id="162479" data-counter="top"></script>
e.g. data-id="162479"
is the ID for Apple Company Page
https://developer.linkedin.com/plugins/follow-company
回答2:
回答3:
a simple way would be to do a file_get_contents on the company page to get the html source and look for "company%3D" and grab the number between that and the next "%"
回答4:
You can download the content of site and find
encodeURIComponent('company=12345')
which appears to be valid company id. Just parse it to get ID.
回答5:
Why not just hover over the 'follow'/'unfollow' of the company/showcase page, this shows the id in the url ?
Or have I missed something ?
回答6:
<html> <head> <script type="text/javascript" src="http://platform.linkedin.com/in.js"> api_key: [API KEY] </script> <script type="text/javascript"> function onGetSuccess(data) { console.log(data); for(var i in data.values){ document.getElementById("company").innerHTML = data.values[i].name + " / " + data.values[i].id; } } function onError(error) { console.log(error); } function GetCompanyLinkedIn() { var url = "/companies/?/updates/format=json&is-company-admin=true"; IN.API.Raw(url) .method("GET") .result(onGetSuccess) .error(onError); } </script> </head> <body id="body"> <div > <script type="IN/Login"> Hello, <?js= firstName ?> <?js= lastName ?> <p id="company" > <button type="button" onclick="GetCompanyLinkedIn()">Get company id('s)</button> </p> </script> </div> </body>
回答7:
Confirming that Andrew's solution worked. Inside the page source, there are multiple scripts with a company%3... data attribute with the company ID; mine was not visible since the URL was customized.
回答8:
try .htaccess file and type the following line
rewriterule ^http://in.linkedin.com/company/abb http://www.linkedin.com/company/277579
回答9:
Hover over the follow button on your company page. https://www.linkedin.com/company/follow/submit?id=6667854&fl=stop&ft=0_Y3kiyf
The ID "6667854"
It works as I followed my company page from another site where it's implemented.