scripts/stars.py
def get_stargazers(url, session=None):
    """
    Return a list of the stargazers of a GitHub repo

    Includes both the 'starred_at' and 'user' data.

    param: url
        url is the 'stargazers_url' of the form:
            https://api.github.com/repos/LLNL/spack/stargazers
    """
    headers = {'Accept': 'application/vnd.github.v3.star+json'}
    url = url + '?per_page=100&page=%s'
    page = 1
    gazers = []

    response = github.get(url % page, headers=headers)
    gazers.extend(response.json())


    #{rel: url for url, rel in LINK_REGEX.findall(r.headers['Link'])}
    while json_data:
        gazers.extend(json_data)
        page += 1
        json_data = github.get(url % page, headers=headers).json()

    return gazers
def get_stargazers(url, session=None):
    """
    Return a list of the stargazers of a GitHub repo

    Includes both the 'starred_at' and 'user' data.

    param: url
        url is the 'stargazers_url' of the form:
            https://api.github.com/repos/LLNL/spack/stargazers
    """
    headers = {'Accept': 'application/vnd.github.v3.star+json'}
    url = url + '?per_page=100&page=%s'
    page = 1
    gazers = []

    response = github.get(url % page, headers=headers)
    gazers.extend(response.json())


    #{rel: url for url, rel in LINK_REGEX.findall(r.headers['Link'])}
    while json_data:
        gazers.extend(json_data)
        page += 1
        json_data = github.get(url % page, headers=headers).json()

    return gazers
Return a list of the stargazers of a GitHub repo

    Includes both the 'starred_at' and 'user' data.

    param: url
        url is the 'stargazers_url' of the form:
            https://api.github.com/repos/LLNL/spack/stargazers