gpt4 book ai didi

python - 通过主邮箱获取github用户名

转载 作者:太空宇宙 更新时间:2023-11-04 06:59:45 26 4
gpt4 key购买 nike

我正在使用 PyGithub 库邀请新成员加入组织。我面临的问题是下一个:在这种情况下,当我只知道用户的主要电子邮件地址时,如何检索他的用户名以相应地进行邀请?我知道通过UI可以,但是通过API找不到对应的调用。请帮忙!

最佳答案

使用github user search api为了这 。我试过下面的。

https://api.github.com/search/users?q=solankiarpit1997@gmail.com

Key name login 是这里的用户名。回应:

{
"total_count": 1,
"incomplete_results": false,
"items": [
{
"login": "arpit1997",
"id": 10682054,
"avatar_url": "https://avatars1.githubusercontent.com/u/10682054?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/arpit1997",
"html_url": "https://github.com/arpit1997",
"followers_url": "https://api.github.com/users/arpit1997/followers",
"following_url": "https://api.github.com/users/arpit1997/following{/other_user}",
"gists_url": "https://api.github.com/users/arpit1997/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arpit1997/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arpit1997/subscriptions",
"organizations_url": "https://api.github.com/users/arpit1997/orgs",
"repos_url": "https://api.github.com/users/arpit1997/repos",
"events_url": "https://api.github.com/users/arpit1997/events{/privacy}",
"received_events_url": "https://api.github.com/users/arpit1997/received_events",
"type": "User",
"site_admin": false,
"score": 52.297474
}
]
}

关于python - 通过主邮箱获取github用户名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44888187/

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