【问题标题】:Thumbnails not showing up after creating a post via linkedin API call通过 linkedin API 调用创建帖子后缩略图未显示
【发布时间】:2022-11-30 18:35:20
【问题描述】:

来自外部网址的缩略图未加载。然而,post inspector tool 加载它就好了。

我用来做一些测试的页面:https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html

到目前为止我尝试过的事情:

  1. 在 url 末尾添加一个额外参数以清除 linkedin 缓存。
  2. 检查后工具
  3. 我做了一些研究,但没有成功找到解决方案。
  4. 我使用不同的链接(例如 youtube 和 stackoverflow)创建了一个帖子。缩略图也没有出现。
  5. 我确保每个页面都有那些允许爬虫检索信息所需的元(开放图)标签。

    这是我一直调用的 API 请求之一的示例(我从 docs 获得):

    `

    {
        "author": "urn:li:person:{ID}",
        "lifecycleState": "PUBLISHED",
        "specificContent": {
            "com.linkedin.ugc.ShareContent": {
                "shareCommentary": {
                    "text": "Learning more about LinkedIn by reading the LinkedIn Blog!"
                },
                "shareMediaCategory": "ARTICLE",
                "media": [
                    {
                        "status": "READY",
                        "description": {
                            "text": "Official LinkedIn Blog - Your source for insights and information about LinkedIn."
                        },
                        "originalUrl": "https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html",
                        "title": {
                            "text": "Official LinkedIn Blog"
                        }
                    }
                ]
            }
        },
        "visibility": {
            "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
        }
    }
    

    `

【问题讨论】:

    标签: linkedin linkedin-api


    【解决方案1】:

    Share Media 对象中,您缺少 media 属性。它接受 LinkedIn URN,因此您需要上传图片。就个人而言,我没有使用该属性,而是使用接受图像 url 的 thumbnails。我不再在文档中看到它,所以可能已经更改了某些内容。至少它仍然对我有用,而且我还没有看到它在更新日志中被弃用。还要注意图像要求。它接受带有此签名的图像 url

    {
      ...,
      "thumbnails": [{
        "url": "https://image-url.com"
      }]
    }

    【讨论】:

      猜你喜欢
      • 2019-05-08
      • 2017-08-02
      • 1970-01-01
      • 2016-11-21
      • 2013-07-02
      • 1970-01-01
      • 2018-09-24
      • 2015-09-28
      • 2016-06-20
      相关资源
      最近更新 更多