Exemplo n.º 1
0
def get_stats(usernames, playlist, platform = 'pc'):

    if not isinstance(usernames, list):
        usernames = [usernames]

    client = Client()
    stats_friends = []
    try:
        for x in usernames:
            response = client.send_request(platform, x.lower())
            stats_friends.append(response[0][playlist])
    except Exception as e:
        print(e)
    return stats_friends
Exemplo n.º 2
0
def get_squad_stats(usernames, platform='psn'):

    if not isinstance(usernames, list):
        usernames = [usernames]

    client = Client()
    stats_friends = []
    try:
        for x in usernames:
            response = client.send_request(platform, x.lower())
            stats_friends.append(response[0]['p9'])
    except Exception:
        ''

    return stats_friends
Exemplo n.º 3
0
def get_all_stats(usernames, platform = 'pc'):
    all_stats = []
    playlist = ['p2','p10','p9']

    if not isinstance(usernames, list):
        usernames = [usernames]
    client = Client()
    stats_friends = []
    try:
        for i in range(3):
            for x in usernames:
                response = client.send_request(platform, x.lower())
                all_stats.append(response[0][playlist[i]])
    except Exception:
        ''
    return all_stats