【问题标题】:How can I get an users website with PyGithub?如何使用 PyGithub 获取用户网站?
【发布时间】:2019-09-23 20:04:46
【问题描述】:

如何使用PyGithub (Github API v3) 获取 GitHub 用户网站(显示在用户个人资料中)?

【问题讨论】:

    标签: pygithub


    【解决方案1】:

    显然在pygithub中。 html_url 是 NamedUser 的一个属性。下面的代码可以让用户进入组织。

    def get_user_html(user_name):
        gh = Github(base_url=url, login_or_token=token)
        org = gh.get_organization(org_name)
        mems = org.get_members()
        for mem in mems:
            if mem.name == user_name:
                print(mem.html_url)
    

    【讨论】:

      【解决方案2】:

      可通过NamedUser.blob 访问用户/组织资料网站。

      【讨论】:

        猜你喜欢
        • 2016-06-24
        • 1970-01-01
        • 1970-01-01
        • 2011-02-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多