LinkedIn JS API共享

问题描述 投票:5回答:2

[我正在尝试确定使用LinkedIn JS API时是否可以传递比共享的URL更多的URL。

我的代码是:

IN.UI.Share().params({
    url: 'http://www.example.com'
}).place.();

现在我已经尝试传递其他参数,例如:

IN.UI.Share().params({
    url: 'http://www.example.com',
    title: 'A Title',
    summary: 'A Small summary'
}).place.();

但是那确实奏效了。似乎只是忽略了那些额外的参数。

我知道我可以使用自定义共享功能来做到这一点:

http://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}

但是我想使用JS API,所以我可以找回令牌来验证它是否正确发布。使用shareArticle方式,大约需要20到30秒才能真正验证是否使用以下方式共享:(https://developer.linkedin.com/retrieving-share-counts-custom-buttons)。

api linkedin
2个回答
0
投票

很遗憾,无法执行此操作。 Linkdin Javascript API和Linkdin Share按钮完全依赖于元标记来抓取信息。真的很遗憾。


0
投票

只需在要共享的页面上设置og:属性标签,那样LinkedIn便会知道titleimage等字段实际上都适合该网站。您可以像这样设置它们...

  • <meta property='og:title' content='Title of the article"/>
  • <meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
  • <meta property='og:description' content='Description that will show in the preview"/>
  • <meta property='og:url' content='//www.example.com/URL of the article" />

来源:LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn

适用于我的网站!

您可以始终使用站点URL上的LinkedIn Poster Inspector以确保您正确执行!! >>

© www.soinside.com 2019 - 2024. All rights reserved.