LinkedIn Share API为我们的URL抛出500错误



我们正在尝试使用LinkedIn share API实现基本的LinkedIn共享链接,但当我们尝试共享我们的web应用程序URL(尤其是(时遇到了问题

JS篡改我们的URL实现:https://jsfiddle.net/Jmackus/qthgoeL1/3/

<a target="_blank" rel="noopener noreferrer" href="https://www.linkedin.com/sharing/share-offsite/?url=https://hcm616.peoplestreme.net/linkedintest-sandbox/erec_external.asp">Share this on LinkedIn</a>

我们从领英得到以下错误:

  • 在浏览器中:"出了问题">

  • 和在控制台:500控制台错误

  • 对我们的URL使用LinkedIn Post Inspector时也会出现500错误:LinkedIn Post Inspector错误

发布检查器URL:https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fhcm616.peoplestreme.net%2Flinkedintest-沙箱%2Forec_external.asp%3FjobId=1

更改浏览器和LinkedIn帐户并不能解决问题,目前我们不确定问题的原因

有人知道是什么原因造成的吗?

您的网页完全是用JavaScript生成的,因此LinkedIn共享URL无法生成预览。它需要预览,所以它可以说";WebSite.com文章网站";,这样平台上的人就可以准确地知道他们在分享什么等等

在HTML的<head>块中设置og:标签,就像这样…

  • <meta property='og:title' content='Title of the website'/>
  • <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' />

来源:领英分享文档:让你的网站在领英上共享

但是,正如你所说的,我将你的URL插入了LinkedIn Post Inspector,这表明它收到了一个服务器500错误。我怀疑可能有一些服务器端阻止代码LinkedIn连接到您的网站?

这是一个我编码的网站,它运行得很好:SortWords.com:Demo Dev网站。看看代码——在LinkedIn上分享是没有问题的。为什么不将演示网站中使用的URL复制/粘贴到new-test-page.html中,直接上传到您的服务器,看看您是否还有问题?也许在那之后用new-test-page.php再试一次?

希望只是og:标签!但我对实施后的结果感到好奇。

最新更新