简体   繁体   English

1x1 像素图像,同时在linkedin 上共享链接

[英]1x1 pixel images while sharing link on linkedin

I am currently having quite problem at hand with linkedin sharing module.我目前在使用linkedin共享模块时遇到了很多问题。

While trying to share an article via link: http://www.rp.pl/Opinie/307189896-Friend-or-Foe.html在尝试通过链接分享文章时: http : //www.rp.pl/Opinie/307189896-Friend-or-Foe.html

which contains opengraph image: http://www.rp.pl/storyimage/RP/20180718/EKO/307189896/AR/0/AR-307189896.jpg?minW=200&minH=200&exactW=600&exactH=351&exactFit=crop其中包含 opengraph 图像: http ://www.rp.pl/storyimage/RP/20180718/EKO/307189896/AR/0/AR-307189896.jpg?minW=200&minH=200&exactW=600&exactH=351&exactFit=crop

via:通过:

https://www.linkedin.com/shareArticle?mini=true&url=http://www.rp.pl/Opinie/307189896-Friend-or-Foe.html https://www.linkedin.com/shareArticle?mini=true&url=http://www.rp.pl/Opinie/307189896-Friend-or-Foe.html

The crawler result which I am getting containt 1x1 pixel images instead on thumbnail of provided og:image image (which works if provided to browser).我得到的爬虫结果包含 1x1 像素图像,而不是提供的 og:image 图像的缩略图(如果提供给浏览器,则可以使用)。

See image:见图片:

在此处输入图片说明

My first conclustion was that for some reason service providing images for url from og:image tag fed LinkedIn crawler with 1x1 pixel image.我的第一个结论是,出于某种原因,服务为来自 og:image 标签的 url 提供图像,并提供了具有 1x1 像素图像的 LinkedIn 爬虫。 However after playing around with chromes dev tools and linkedin share page I have discovered that most likely LinkedIn crawler is getting expected image (the same that browser is getting when visiting link from og:image tag) because deep in LinkedIn share page there is proper image size which is not provided via page containing og:image tag - see image below:然而,在使用了 chromes 开发工具和 linkedin 共享页面之后,我发现 LinkedIn 爬虫很可能正在获取预期的图像(与浏览器从 og:image 标签访问链接时获得的图像相同),因为在 LinkedIn 共享页面的深处有正确的图像尺寸不是通过包含 og:image 标签的页面提供的 - 见下图:

在此处输入图片说明

Image size value is equal to contents-length header for that image.图像大小值等于该图像的内容长度标头。

So knowing that I started to play around with LinkedIn crawler to see how it reacts to absent images and corrupted ones.所以知道我开始玩 LinkedIn 爬虫,看看它如何对缺失的图像和损坏的图像做出反应。

For absent ones it behaves as expected - does not show this image in share page.对于缺席的人,它的行为符合预期 - 不会在共享页面中显示此图像。 However for corrupted ones it provides 1x1 pixel.然而,对于损坏的,它提供 1x1 像素。

For all above I am preatty sure that LinkedIn clrawler treats images provided by ours service as corrupted but I could not find any requirements list for images provided to LinkedIn crawler.对于上述所有内容,我很确定 LinkedIn 爬虫将我们服务提供的图像视为已损坏,但我找不到提供给 LinkedIn 爬虫的图像的任何要求列表。

I was wondering if anyone else had similiar issue and maybe there is solution to that problem.我想知道是否还有其他人有类似的问题,也许该问题有解决方案。

PS.附注。 Those same images work like a charm on facebook while sharing.这些相同的图像在分享时就像 Facebook 上的魅力一样。

PPS.聚苯乙烯。 Some times non-working images in LinkedIn share are getting to work eventually - which might seem that these images are generally OK.有时 LinkedIn 共享中的非工作图像最终会起作用 - 这些图像似乎通常没问题。

It seems like your share URL and image are actually working just fine now:看起来您的共享 URL 和图像现在实际上工作正常:

There can be many, many reasons why an og:image tag might be ignored!可能有很多很多原因导致og:image标签可能被忽略! Fortunately, the LinkedIn team discovered this, and put together this useful tool for debugging how you're sharing: LinkedIn Post Inspector - For LinkedIn Sharing URLs .幸运的是,LinkedIn 团队发现了这一点,并整合了这个有用的工具来调试您的共享方式: LinkedIn Post Inspector - For LinkedIn Sharing URLs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM