【问题标题】:LinkedIn JS API ShareLinkedIn JS API 共享
【发布时间】:2013-04-29 14:25:22
【问题描述】:

我试图弄清楚在使用 LinkedIn JS API 时是否可以传递多个 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


    【解决方案1】:

    不幸的是,没有办法做到这一点。 Linkdin Javascript API 和 Linkdin Share 按钮完全依赖元标记来抓取信息。真的很遗憾。

    【讨论】:

      【解决方案2】:

      只需在您共享的页面上设置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 以确保您做得对!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-06-13
        • 2013-07-08
        • 1970-01-01
        • 2014-07-08
        • 1970-01-01
        • 2020-07-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多