<jupyter_start><jupyter_text>Steam Game Vectorize Program<jupyter_code>import requests as req
import sys
apiKey = open("APIKey.txt", "r").readline().strip().split("=")[1].strip('"')
def api_call(start, mid, end="", userID="76561197960435530", key=apiKey):
    request_string = start+key+mid+str(userID)+end
    result = req.get(request_string)
    if result.status_code == 200:
        return result.json()
    else:
        print("Error while reaching:")
        print(request_string)
        raise Exception(result.status_code)
        return
    
#Returns API URL for player summaries; #key is api key, uesrID is one or list of userIDs for steam users
def get_player_sum(user="76561197978184570", api_key=apiKey):
    p_start = "http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key="
    p_end = "&steamids="
    return api_call(p_start, p_end, userID=user, key=api_key)['response']['players']

def get_player_friends(user="76561197978184570", api_key=apiKey):
    p_start = "http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key="
    p_mid = "&steamid="
    p_end = "relationship=friend"
    return api_call(p_start, p_mid, p_end, user, api_key)['friendslist']['friends']
    
def get_recent_games(user="76561<PASSWORD>78184570", api_key=apiKey):
    p_start = "http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key="
    p_mid = "&steamid="
    p_end = "&format=json"
    return api_call(p_start, p_mid, p_end, user, api_key)['response']['games']

def get_all_games(user="76561197978184570", api_key=apiKey):
    p_start = "http://api.steampowered.com/IPlayerService/GetOwnedGames/v0001/?key="
    p_mid   = "&steamid="
    p_end     = "&format=json"
    return api_call(p_start, p_mid, p_end, user, api_key)['response']['games']

def get_game_name(gameID, api_key=apiKey):
    p_start = "http://api.steampowered.com/ISteamUserStats/GetSchemaForGame/v2/?key="
    p_mid = "&appid="
    return api_call(p_start, p_mid, userID=gameID, key=api_key)['game']['gameName']
r = get_player_friends()
r
from queue import Queue
MAX_USERS = 50
minedUserIDs = set()
minedUserIDs.add(76561197978184570)
toExplore = Queue()
for friend in r:
    ID = int(friend['steamid'])
    toExplore.put(ID)
    minedUserIDs.add(ID)

print(minedUserIDs)
print(toExplore)<jupyter_output>{76561198297510146, 76561198039276037, 76561198089390984, 76561197963600137, 76561197998960393, 76561198049945609, 76561198057056652, 76561197997710611, 76561198052912535, 76561198084423834, 76561198125215133, 76561198007882536, 76561198036868521, 76561198052848554, 76561198069122345, 76561198247044520, 76561198027693614, 76561198203050287, 76561198040910902, 76561198057166518, 76561198130447801, 76561198193396923, 76561198053110849, 76561198084252609, 76561198095415748, 76561198065824838, 76561198328331080, 76561198040636882, 76561198083780949, 76561198046658137, 76561198062030175, 76561198014092640, 76561198045714404, 76561198035549158, 76561198040131174, 76561198067247463, 76561198069353711, 76561198001392240, 76561198061440112, 76561198127893103, 76561198129300595, 76561198255540725, 76561198087270520, 76561197978184570}
<queue.Queue object at 0x7fda353c1470>
{'fraction_non_alphanumeric': 0.12013801756587202, 'fraction_numerical': 0.27540777917189463, 'mean_word_length': 6.416279069767442, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '178889', 'license': 'MIT', 'n_tokens_mistral': 1821, 'n_tokens_neox': 1261, 'n_words': 195, 'path': '.ipynb_checkpoints/DataAnalysis-checkpoint.ipynb', 'repo_name': 'pelovett/game2vec', 'size': '3182'}