Create direct url to LinkedIn company update

混江龙づ霸主 提交于 2019-12-04 17:10:01

问题


I'm implementing a Compony newsfeed on a website and ran into the following problem. The LinkedIn API doesn't provide a direct URL to a company update. Looking at the LinkedIn site there are direct URL's and they're like this for example: https://www.linkedin.com/company/1441/comments?topic=5849556347070205952&type=U&scope=1441&stype=C&a=5uHW&goback=%2Ebzo_*1_*1_*1_*1_*1_*1_*1_1441

Trying stuff out it seems that the parameters topic, type, scope, stype and a are mandatory for the URL to work.. (goback is the only one that isn't).

Using the LinkedIn API with the Company updates call I'm able to buid the direct url, except for the a parameter. The value is always 4 (for me unexplainable) characters long.

Has anyone ever successfully build a direct URL to a company update or can someone maybe explain the a parameter or how to generate its value?


回答1:


Updated to new format

You can link directly to any update (company or user) using the following url:

https://www.linkedin.com/feed/update/urn:li:activity:[topic_id]

You can get [topic_id] by getting the last bit of the updateKey in the api response from Linkedin. When updateKey = UPDATE-c7352-6410848097894756353, your topic_id = 6410848097894756353.

In your example that would become https://www.linkedin.com/feed/update/urn:li:activity:5849556347070205952 which links directly to the specific update. The post is too old to work with the new link format


The url used to be

https://www.linkedin.com/nhome/updates/?topic=[topic_id]

Updated thanks to the comment from @sethpollack




回答2:


For anyone trying to get the topic id from the API response object (as already commented on the OP question), the topic id is the value after the last hyphen of the updateKey property, which can be used with @Daan answer:

"updateKey": "UPDATE-cXXXX-YYYYYYYYYYYYYYYYYY"

Direct URL:

https://www.linkedin.com/nhome/updates?topic=[YYYYYYYYYYYYYYYYYY]



回答3:


Using the URL format above, get the topic_id by opening the update in its own window/tab, look at the page source code in your browser and search for the string :activity: the long number after the string is the infamous topic_id



来源:https://stackoverflow.com/questions/22915856/create-direct-url-to-linkedin-company-update

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!