gpt4 book ai didi

github - 如何获得 github 项目的社交预览?

转载 作者:行者123 更新时间:2023-12-04 10:31:56 25 4
gpt4 key购买 nike

我可以获得该项目,但它没有检索到 Social Preview项目简介:

enter image description here

我正在使用的链接是这个:https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD
它返回以下内容:

{
"id": 215636067,
"node_id": "MDEwOlJlcG9zaXRvcnkyMTU2MzYwNjc=",
"name": "BCMIC-PHD",
"full_name": "AngelRibeiro10/BCMIC-PHD",
"private": false,
"owner": {
"login": "AngelRibeiro10",
"id": 13433634,
"node_id": "MDQ6VXNlcjEzNDMzNjM0",
"avatar_url": "https://avatars2.githubusercontent.com/u/13433634?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/AngelRibeiro10",
"html_url": "https://github.com/AngelRibeiro10",
"followers_url": "https://api.github.com/users/AngelRibeiro10/followers",
"following_url": "https://api.github.com/users/AngelRibeiro10/following{/other_user}",
"gists_url": "https://api.github.com/users/AngelRibeiro10/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AngelRibeiro10/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AngelRibeiro10/subscriptions",
"organizations_url": "https://api.github.com/users/AngelRibeiro10/orgs",
"repos_url": "https://api.github.com/users/AngelRibeiro10/repos",
"events_url": "https://api.github.com/users/AngelRibeiro10/events{/privacy}",
"received_events_url": "https://api.github.com/users/AngelRibeiro10/received_events",
"type": "User",
"site_admin": false
},
"html_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"description": "This is a Brain-Computer Music Interfacing Project",
"fork": false,
"url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD",
"forks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/forks",
"keys_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/keys{/key_id}",
"collaborators_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/collaborators{/collaborator}",
"teams_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/teams",
"hooks_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/hooks",
"issue_events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/events{/number}",
"events_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/events",
"assignees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/assignees{/user}",
"branches_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/branches{/branch}",
"tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/tags",
"blobs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/blobs{/sha}",
"git_tags_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/tags{/sha}",
"git_refs_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/refs{/sha}",
"trees_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/trees{/sha}",
"statuses_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/statuses/{sha}",
"languages_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/languages",
"stargazers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/stargazers",
"contributors_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contributors",
"subscribers_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscribers",
"subscription_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/subscription",
"commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/commits{/sha}",
"git_commits_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/git/commits{/sha}",
"comments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/comments{/number}",
"issue_comment_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues/comments{/number}",
"contents_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/contents/{+path}",
"compare_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/compare/{base}...{head}",
"merges_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/merges",
"archive_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/{archive_format}{/ref}",
"downloads_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/downloads",
"issues_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/issues{/number}",
"pulls_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/pulls{/number}",
"milestones_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/milestones{/number}",
"notifications_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/notifications{?since,all,participating}",
"labels_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/labels{/name}",
"releases_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/releases{/id}",
"deployments_url": "https://api.github.com/repos/AngelRibeiro10/BCMIC-PHD/deployments",
"created_at": "2019-10-16T20:14:22Z",
"updated_at": "2019-11-14T16:52:13Z",
"pushed_at": "2019-11-14T16:52:11Z",
"git_url": "git://github.com/AngelRibeiro10/BCMIC-PHD.git",
"ssh_url": "git@github.com:AngelRibeiro10/BCMIC-PHD.git",
"clone_url": "https://github.com/AngelRibeiro10/BCMIC-PHD.git",
"svn_url": "https://github.com/AngelRibeiro10/BCMIC-PHD",
"homepage": null,
"size": 69612,
"stargazers_count": 0,
"watchers_count": 0,
"language": null,
"has_issues": true,
"has_projects": true,
"has_downloads": true,
"has_wiki": true,
"has_pages": false,
"forks_count": 0,
"mirror_url": null,
"archived": false,
"disabled": false,
"open_issues_count": 0,
"license": {
"key": "apache-2.0",
"name": "Apache License 2.0",
"spdx_id": "Apache-2.0",
"url": "https://api.github.com/licenses/apache-2.0",
"node_id": "MDc6TGljZW5zZTI="
},
"forks": 0,
"open_issues": 0,
"watchers": 0,
"default_branch": "master",
"temp_clone_token": null,
"network_count": 0,
"subscribers_count": 1
}

我想得到这张“社交预览”的照片......但它没有显示在项目属性的返回中。

非常感谢 :)

最佳答案

所以不可能从 API 中检索它,但在我的情况下,因为我只在我的网站上显示了我的前三个存储库,所以手动获取图像 URL 并不难。

我通过在 GitHub 上上传预览图像来做到这一点,然后在图像弹出时右键单击 -> 检查,您将在开发人员工具中看到该元素具有“背景图像:url()”属性,右键单击在该 URL 上,然后在新选项卡中打开,您的图像的 URL 就在这里!

就像我说的,这是一个手动过程,但如果你只需要做几次,那么这没什么大不了的。那是我的解决方法。

关于github - 如何获得 github 项目的社交预览?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60381683/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com